Opened 2 years ago
Closed 2 years ago
Last modified 2 years ago
Patch for zero length malloc in ParseBinary.cpp
|Reported by:||Gary Buhrmaster <gary.buhrmaster@…>||Owned by:||Gary Buhrmaster <gary.buhrmaster@…>|
|Component:||MythTV - General||Version:||Master Head|
Static analysis (scan-build) detected a feasible code path such that the string will have a length of zero when ParseString? is called. Malloc of a zero length has a implementation dependent result (i.e. possible invalid memory pointer). Add one to the requested length to eliminate the ambiguity. In addition, check the return from malloc to insure it was successful (should have been be a different static analysis detected error, but I did not see it in the reports).