-
Notifications
You must be signed in to change notification settings - Fork 498
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
_vsnprintf reads past the format parameter value #139
Comments
Fixing this needs sanitizing width/precision parsing, adding code that is used only in malformed program. |
@ledvinap I agree with you all input needs to be sanitized by the caller of |
It's not '%.'. '%\0' will behave the same, putting '\0' into output stream and continuing format expansion. Special-casing '\0' in format character |
@ledvinap I will try that case as well. Thanks! It also fails in the fork. |
…hen a format specifier does not end before the string does.
So, this is not a bug, as incomplete format specifier at string end cause undefined behavior. I am considering an opt-in "sanitization" via a CMake option - please have a look at eyalroz#140. But - this issue needs to be closed. @aptly-io : Please close this... |
…hen a format specifier does not end before the string does.
…hen a format specifier does not end before the string does.
…hen a format specifier does not end before the string does.
…hen a format specifier does not end before the string does.
…hen a format specifier does not end before the string does.
…hen a format specifier does not end before the string does.
…hen a format specifier does not end before the string does.
…option of Craig Scott's `FetchContent`-friendliness approach
This code snippet illustrates the issue (the issue does not manifest when using libc's printf):
(it can likely be abused by a hacker for malicious purposes)
Compile like this:
The output:
The text was updated successfully, but these errors were encountered: