-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Critical bug: buffer overflow in catch
's handling of arguments
#665
Comments
Specifically, in if( std::string( ":=\0", 5 ).find( c ) == std::string::npos ) The length of string literal is only 3, yet the constructor reads 5 chars out of it. Similarly, in if( inQuotes || std::string( "\0", 3 ).find( c ) == std::string::npos ) The constructor reads 3 characters out of length-1 string literal. Both of these cases result in undefined behavior. |
I agree this is a bug. It was introduced in v1.5.2. suggest these fixes: |
I have already created a pull request in Clara to fix this problem: catchorg/Clara#17 |
Ouch! Sorry about that. I'll try and get this sorted (in both code bases) later today - thanks for bringing it up (and @rioderelfte for the PR) |
Thanks for fixing this in v1.5.6. |
Since this was fixed, I am closing the issue. |
Compiling with address sanitizer that comes with the latest
gcc
orclang
, we can find that the latestcatch
has buffer overflow when parsing arguments. Here is a screenshot:Both v1.5.4 and v1.5.3 have the same bug. I have not tested earlier versions.
The text was updated successfully, but these errors were encountered: