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

Ouf-of-bound access in operator>>(mph) #4

Open
LucHermitte opened this issue Feb 4, 2016 · 0 comments
Open

Ouf-of-bound access in operator>>(mph) #4

LucHermitte opened this issue Feb 4, 2016 · 0 comments

Comments

@LucHermitte
Copy link

In https://github.com/ossimlabs/ossim-plugins/blob/master/cnes/src/EnvisatAsar/mph.cpp#L228

Line 228, buf1 is defined as an array of one char. Later (line 249), it's assigned into a std::string.

As there is no guarantee the array is null terminated, an invalid read will be performed. Either the array shall become a single char, or it should be made of two chars, the last one being null.

BTW, no need to write the copy constructor nor the assignment operator, the default generated ones will be fine as the class is made of copyable and assignable attributes. This way, it'll also permit the compiler to generate the move constructor and the move assignment operator in C++11.

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

No branches or pull requests

1 participant