Opened 10 years ago

Closed 10 years ago

#6997 closed defect (fixed)

libmythdvdnav defects

Reported by: Erik Hovland <erik@…> Owned by: paulh
Priority: minor Milestone: 0.22
Component: MythTV - General Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

  1. Close a resource leak in an error path.
  2. Use parens to guarantee the correct operator precedence.
  3. Missing curly braces causes a lock to stay locked in an error path.
  4. An array is indexed incorrectly opening the possibility of indexing out of bounds.

Attachments (5)

libs_libmythdvdnav-resource-leak (766 bytes) - added by Erik Hovland <erik@…> 10 years ago.
Close leak in error path
libs_libmythdvdnav-precedence-fix (1.0 KB) - added by Erik Hovland <erik@…> 10 years ago.
Use parens to guarantee precedence
libs_libmythdvdnav-missing-lock (923 bytes) - added by Erik Hovland <erik@…> 10 years ago.
Use curly braces to unlock mutex in error path
libs_libmythdvdnav-dont-overrun-arrays (822 bytes) - added by Erik Hovland <erik@…> 10 years ago.
Index at i-1 to prevent overrun of the array.
changes_on_searching_c_dvdnav.diff (835 bytes) - added by skamithi 10 years ago.
fix typo in searching.c , after the major upgrade about 5 months ago, i made a type in the for loop statement.

Download all attachments as: .zip

Change History (12)

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

Close leak in error path

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

Use parens to guarantee precedence

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

Use curly braces to unlock mutex in error path

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

Index at i-1 to prevent overrun of the array.

comment:1 Changed 10 years ago by paulh

Milestone: unknown0.22
Owner: changed from Isaac Richards to paulh
Status: newassigned

comment:2 Changed 10 years ago by paulh

(In [21716]) Fix a leak after error. Refs #6997.

comment:3 Changed 10 years ago by paulh

(In [21717]) Fix a leak after error. Refs #6997.

comment:4 Changed 10 years ago by paulh

(In [21718]) Add missing curly braces. Refs #6997.

comment:5 Changed 10 years ago by paulh

Erik, have you verified No. 4 is correct? I can see there is something wrong since the fwda[] array has only 19 members but are you sure your fix is correct? Also shouldn't the same be done for the bwda[] array in the next else block?

comment:6 Changed 10 years ago by Erik Hovland <erik@…>

Sadly, the code base is too large and my brain is too feeble to be really sure that this one is correct. But let me see...This change is not yet tested by me. Sorry. Feel free to close the ticket and mention that the patch is rejected. I will get it tested and resubmit if it still works.

Note that the mplayerhq folk have removed this code entirely from their tree. So it is likely that it is never used.

Changed 10 years ago by skamithi

fix typo in searching.c , after the major upgrade about 5 months ago, i made a type in the for loop statement.

comment:7 Changed 10 years ago by skamithi

Resolution: fixed
Status: assignedclosed

(In [21738]) Closes #6997. fix typo in searching.c that may cause an overrun. detected by Erik Hovland.

Note: See TracTickets for help on using tickets.