Opened 16 years ago

Closed 16 years ago

#5303 closed defect (fixed)

memset usage in mythcommflag a little wonky

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

Description

Not every compiler is going to do the right thing when given a sizeof(array) as the number of bytes it should be setting. But mythcommflag does this in a few places.

Attachments (2)

programs_mythcommflag_ClassicCommDetector.cpp-do-memset-correctly.patch (1.2 KB) - added by Erik Hovland <erik@…> 16 years ago.
programs_mythcommflag_ClassicCommDetector.cpp-do-memset-correctly-ticket-5303.patch (834 bytes) - added by Erik Hovland <erik@…> 16 years ago.
reverts the sizeof back to original (it was/is correct), keeps referencing removal

Download all attachments as: .zip

Change History (4)

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

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

reverts the sizeof back to original (it was/is correct), keeps referencing removal

comment:1 Changed 16 years ago by Erik Hovland <erik@…>

The second patch replaces the first. The static analysis checker I am using was shown to be at fault with exposing a defect associated with sizeof and variable size arrays. So the original code is correct with the sizeof call. The new patch only removes the referencing operator from the array since that is superfluous (and possibly incorrect).

comment:2 Changed 16 years ago by danielk

Resolution: fixed
Status: newclosed

(In [17518]) Fixes #5303. Fixes a buffer clearing which tried to clear the pointers to buffers rather than the buffers themselves.

Note: See TracTickets for help on using tickets.