Skip to content
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

Fix misuse of sprintf() in imphash() #114

Merged
merged 1 commit into from
Jul 17, 2017
Merged

Fix misuse of sprintf() in imphash() #114

merged 1 commit into from
Jul 17, 2017

Conversation

jwilk
Copy link
Contributor

@jwilk jwilk commented Jul 17, 2017

From the snprintf manpage:

Some programs imprudently rely on code such as the following

sprintf(buf, "%s some further text", buf);

to append text to buf. However, the standards explicitly note that the results are undefined if source and destination buffers overlap when calling sprintf(), snprintf(), vsprintf(), and vsnprintf(). Depending on the version of gcc(1) used, and the compiler options employed, calls such as the above will not produce the expected results.

The results are undefined if source and destination buffers overlap when
calling sprintf().
@jweyrich
Copy link
Contributor

Good catch!

@jweyrich jweyrich merged commit 7f62997 into mentebinaria:master Jul 17, 2017
@jwilk jwilk deleted the imphash-sprintf branch July 17, 2017 13:37
@jweyrich jweyrich added this to the v0.81 milestone Jul 17, 2017
@jweyrich jweyrich added the v0.81 label Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants