Opened 5 years ago

Closed 5 years ago

#12238 closed Patch - Bug Fix (fixed)

Patch to address technical violation of memcpy null source address

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

Description

Static analysis (scan-build) reported that memcpy could be called with a NULL source address (where length would be zero) when following specific code paths. That is technically a violation of the library function (although most known implementations would operate properly without producing a fault with a length of zero). This patch provides the appropriate check to avoid/resolve the potential issue. One less static analysis reported bug.

Visual check of the code only (the "it looks reasonable to me" check), I have no CAM devices to even consider testing with.

github ref: https://github.com/garybuhrmaster/mythtv/commit/91cb0eae37011db0a916c59cb28d4c3b3351efe5 github git-am ref: https://github.com/garybuhrmaster/mythtv/commit/91cb0eae37011db0a916c59cb28d4c3b3351efe5.patch

Change History (2)

comment:1 Changed 5 years ago by stuartm

Milestone: unknown0.28
Owner: set to stuartm
Status: newaccepted

comment:2 Changed 5 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Resolution: fixed
Status: acceptedclosed

In b1056152f9313abf4e512fa5be6b42531b2b7cbd/mythtv:

Patch for static analysis and NULL source pointer to memcpy

With additional changes by Stuart Morgan to guard against a negative Length.

Fixes #12238

Signed-off-by: Stuart Morgan <smorgan@…>

Note: See TracTickets for help on using tickets.