{"action":"opened","issue":{"url":"https://api.github.com/repos/ossimlabs/ossim-plugins/issues/4","repository_url":"https://api.github.com/repos/ossimlabs/ossim-plugins","labels_url":"https://api.github.com/repos/ossimlabs/ossim-plugins/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/ossimlabs/ossim-plugins/issues/4/comments","events_url":"https://api.github.com/repos/ossimlabs/ossim-plugins/issues/4/events","html_url":"https://github.com/ossimlabs/ossim-plugins/issues/4","id":131395519,"number":4,"title":"Ouf-of-bound access in `operator>>(mph)`","user":{"login":"LucHermitte","id":501871,"avatar_url":"https://avatars.githubusercontent.com/u/501871?v=3","gravatar_id":"","url":"https://api.github.com/users/LucHermitte","html_url":"https://github.com/LucHermitte","followers_url":"https://api.github.com/users/LucHermitte/followers","following_url":"https://api.github.com/users/LucHermitte/following{/other_user}","gists_url":"https://api.github.com/users/LucHermitte/gists{/gist_id}","starred_url":"https://api.github.com/users/LucHermitte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucHermitte/subscriptions","organizations_url":"https://api.github.com/users/LucHermitte/orgs","repos_url":"https://api.github.com/users/LucHermitte/repos","events_url":"https://api.github.com/users/LucHermitte/events{/privacy}","received_events_url":"https://api.github.com/users/LucHermitte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-04T16:10:40Z","updated_at":"2016-02-04T16:10:40Z","closed_at":null,"body":"In https://github.com/ossimlabs/ossim-plugins/blob/master/cnes/src/EnvisatAsar/mph.cpp#L228\r\n\r\nLine 228, `buf1` is defined as an array of one `char`. Later (line 249), it's assigned into a `std::string`.\r\n\r\nAs 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 `char`s, the last one being null.\r\n\r\nBTW, 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."}}