Fix stack overflow in: inotifytools_replace_filename#104
Merged
ericcurtin merged 1 commit intoinotify-tools:masterfrom Jan 27, 2020
Merged
Fix stack overflow in: inotifytools_replace_filename#104ericcurtin merged 1 commit intoinotify-tools:masterfrom
inotifytools_replace_filename#104ericcurtin merged 1 commit intoinotify-tools:masterfrom
Conversation
``` /var/cache/dnf/fedora-modular-42f5060c2cfa4ffa/ MOVED_TO,ISDIR repodata *** stack smashing detected ***: <unknown> terminated % #0 0x0000ffffa6d08c90 in raise () from /usr/lib64/libc.so.6 % inotify-tools#1 0x0000ffffa6cf6aa8 in abort () from /usr/lib64/libc.so.6 % inotify-tools#2 0x0000ffffa6d42acc in __libc_message () from /usr/lib64/libc.so.6 % inotify-tools#3 0x0000ffffa6db4f54 in __fortify_fail_abort () from /usr/lib64/libc.so.6 % inotify-tools#4 0x0000ffffa6db4f08 in __stack_chk_fail () from /usr/lib64/libc.so.6 % inotify-tools#5 0x0000ffffa6e4f958 in inotifytools_replace_filename (oldname=<optimized out>, newname=<optimized out>) at inotifytools.c:866 % inotify-tools#6 0x0000aaaab1b5de98 in main (argc=<optimized out>, argv=<optimized out>) at inotifywait.c:389 ``` A simple fix would be: ``` char *names[2+(sizeof(int)+sizeof(char*)-1)/sizeof(char*)]; ``` A similar fix is in: ``` inotify-tools_3.14-8.debian/debian/patches/0006-Fix-buffer-overrun-in-inotifytools.c.patch ``` I find the attached struct for callback data as a more clean and standard solution.
Closed
ericcurtin
approved these changes
Jan 27, 2020
Member
ericcurtin
left a comment
There was a problem hiding this comment.
Nice work, much more typesafe!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A simple fix would be:
A similar fix is in:
I find the attached struct for callback data as a more clean and standard
solution.