Skip to content

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

@LucHermitte

Description

@LucHermitte

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions