Modify

Ticket #5504 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

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

Reported by: Erik Hovland <erik@…> Owned by: ijr
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

libs_libmythdb-dont-pass-null-to-write.patch (1.6 KB) - added by Erik Hovland <erik@…> 4 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@…> 3 years ago.
Fresh patch for old ticket.

Change History

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

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

comment:1 Changed 4 years ago by danielk

  • Version changed from unknown to head

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 3 years ago by Erik Hovland <erik@…>

Fresh patch for old ticket.

comment:2 Changed 3 years ago by cpinkham

  • Status changed from new to closed
  • Resolution set to fixed

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

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.