-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer overflows #13
Comments
What about the |
@ryandesign I see the problem, but I don't have a Mac to properly test the fix. Would you be so kind to review my PR that aims to fix this? |
When compiling the latest master on macOS High Sierra, clang points out a couple buffer overflows in your code:
Here, it looks like you're copying
UNIX_PATH_MAX
bytes to thesun_path
field of astruct sockaddr_un
, and in tcp2unix.h you've definedUNIX_PATH_MAX
as 108, which as far as I can tell is correct for Linux systems, but based on cursory research, it seems that different operating systems use different sizes for this field, down to as small as 92 bytes. On my macOS system, thesun_path
field's length is 104 bytes.In this case, I think the problem is that you're allocating the variable
foot
based on the size of a pointer rather than the size of the struct that the pointer points to.The text was updated successfully, but these errors were encountered: