Skip to content

Conversation

ayyess
Copy link

@ayyess ayyess commented Mar 14, 2016

This should fix #72

The +3 should be for 1 null byte and 2 integers.

@dgraziotin
Copy link
Collaborator

Thank you for this. For several reasons, I am unable to test it under Linux for a month or so. Do you confirm that this fixes #72 as well? As it looks good to me, I would just merge it. But please, confirm that compiling with D_FORTIFY_SOURCE=2 does not make it crash.

@ayyess
Copy link
Author

ayyess commented Mar 17, 2016

I tested with D_FORTIFY_SOURCE=2 and it does not crash.

The second commit is because malcolmlewis was right with +2. I miscounted the for-loop.

@dgraziotin
Copy link
Collaborator

Alright. Thank you!

@dgraziotin dgraziotin closed this Mar 17, 2016
@dgraziotin dgraziotin reopened this Mar 17, 2016
dgraziotin added a commit that referenced this pull request Mar 17, 2016
Fix buffer overflow in sprintf
@dgraziotin dgraziotin merged commit f2736c8 into linux-on-mac:master Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buffer overflow when compiled with -D_FORTIFY_SOURCE=2
2 participants