Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#11570 closed Patch - Bug Fix (fixed)

Patch for zero length malloc in ParseBinary.cpp

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by: Gary Buhrmaster <gary.buhrmaster@…>
Priority: minor Milestone: 0.27
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

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).

https://github.com/garybuhrmaster/mythtv/commit/28a77c36e2d320fa1304ad3822d5359b05af07a0

Change History (2)

comment:1 by Gary Buhrmaster <gary.buhrmaster@…>, 13 years ago

Owner: set to Gary Buhrmaster <gary.buhrmaster@…>
Resolution: fixed
Status: newclosed

In b44f38e8487d521685521a8a50b12119d23e1cb8/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:2 by paulh, 13 years ago

Milestone: unknown0.27
Note: See TracTickets for help on using tickets.