Opened 9 months ago
Closed 9 months ago
Last modified 9 months 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).