Opened 11 years ago

Closed 10 years ago

#5504 closed defect (fixed)

Passing a null pointer to write() is a bad idea any time (in libmythdb)

Reported by: Erik Hovland <erik@…> Owned by: Isaac Richards
Priority: trivial Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

The tcp/udp write calls in msocketdevice_unix.cpp can pass a null pointer to write() if the length of the data to write is zero. Although this is unlikely to be a problem, it would be better if we never passed a null pointer to write() ever.

Attachments (2)

libs_libmythdb-dont-pass-null-to-write.patch (1.6 KB) - added by Erik Hovland <erik@…> 11 years ago.
short ckt zero length buffer writes so null is not passed to write()
libs_libmythdb-dont-pass-null-to-write-ticket-5504.patch (1.6 KB) - added by Erik Hovland <erik@…> 11 years ago.
Fresh patch for old ticket.

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Erik Hovland <erik@…>

short ckt zero length buffer writes so null is not passed to write()

comment:1 Changed 11 years ago by danielk

Version: unknownhead

I'll keep the ticket open while we are still using msocketdevice, but this code is probably going away. Once we switch completely to Qt4 we won't be initializing the Qt3 network stack at startup and we'll probably need to replace this code.

Changed 11 years ago by Erik Hovland <erik@…>

Fresh patch for old ticket.

comment:2 Changed 10 years ago by cpinkham

Resolution: fixed
Status: newclosed

(In [21388]) Do a little bit more sanity checking on the input to MSocketDevice::writeData() and MSocketDevice::writeBlock() to guarantee we don't try to pass a null pointer when writing data to the socket.

Closes #5504 using unix patch by Erik Hovland, copied to _win.cpp by myself.

Note: See TracTickets for help on using tickets.