You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
In https://github.com/ossimlabs/ossim-plugins/blob/master/cnes/src/EnvisatAsar/mph.cpp#L228
Line 228,
buf1
is defined as an array of onechar
. Later (line 249), it's assigned into astd::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 twochar
s, 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.
The text was updated successfully, but these errors were encountered: