Opened 14 years ago

Closed 13 years ago

#3927 closed defect (fixed)

ignytegrabber: mythsoap does not NULL terminate data

Reported by: anonymous Owned by: paulh
Priority: minor Milestone: 0.21
Component: mythmovies Version: head
Severity: low Keywords:
Cc: Ticket locked: no


MythSoap::httpDone() places the retrieved data into a QByteArray called m_data. m_data is passed via MythSoap::getResponseData() to IgnyteGrabber::checkHttp() which uses QByteArray::data() to implicitly construct a QString. The problem is that this particular constructor expects NULL terminated data but QByteArray::data() returns a raw non-terminated pointer to the HTTP data. This can cause garbage to appear at the end of the constructed string. The attached patch contains a fix.

The bug doesn't affect IgnyteGrabber? because it does not do particularly robust checking of the returned data. However, other plugins (e.g. the one I am working on) may want to use mythsoap in the future and this garbage data might cause problems.

Attachments (2)

mythsoap-null-terminate.patch (1.2 KB) - added by dburr@… 14 years ago.
NULL terminate data returned from mythsoap
mythsoap-null-terminate.2.patch (1.7 KB) - added by Daniel Burr 14 years ago.
Updated patch to add a 'getError' method

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by dburr@…

NULL terminate data returned from mythsoap

Changed 14 years ago by Daniel Burr

Updated patch to add a 'getError' method

comment:1 Changed 14 years ago by stuartm

Owner: changed from stuartm to Isaac Richards

comment:2 Changed 13 years ago by paulh

Owner: changed from Isaac Richards to paulh
Status: newassigned

comment:3 Changed 13 years ago by paulh

Resolution: fixed
Status: assignedclosed

(In [15270]) Make sure MythSoap? NULL terminates its data.

Patch by Daniel Burr. Closes #3927.

Note: See TracTickets for help on using tickets.