Skip to content

Commit

Permalink
Always zero inotify_event len field to prevent attempts to read rando…
Browse files Browse the repository at this point in the history
…m len of data from inotify.
  • Loading branch information
HeisSpiter committed Dec 5, 2014
1 parent e4c6ec9 commit fac6acc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2014-12-05 Pierre Schweitzer <pierre@reactos.org>

* ForbidHosts.cpp: Always zero inotify_event len field to prevent attempts to read random len of data from inotify.

2014-12-03 Pierre Schweitzer <pierre@reactos.org>

* ForbidHosts.cpp: Fix the reinit of the inotify watch for the log file. We only watch modifications.
Expand Down
1 change: 1 addition & 0 deletions ForbidHosts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ int main(int argc, char ** argv) {

// Read the pending event
// It will concern iAuth
iEvent.Event.len = 0;
soft_assert(read(iNotify, &iEvent, offsetof(struct inotify_event, name)) ==
offsetof(struct inotify_event, name));

Expand Down

0 comments on commit fac6acc

Please sign in to comment.