Opened 16 years ago

Closed 16 years ago

#4844 closed defect (fixed)

don't dereference this if it doesn't exist in dvdnav_internal.h

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

Description

In dvdnav_internal.h, printerr is defined as:

#define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN);

Unfortunately, all over the code functions call:

  if(!this) {
    printerr("Passed a NULL pointer.");
    return DVDNAV_STATUS_ERR;
  }

Which means that instead of printing an error it will try to dereference a null pointer and segfault.

Attachments (1)

libs_libmythdvdnav_dvdnav_internal.h-make-sure-printerr-doesnt-dreference-null-pointers.patch (749 bytes) - added by Erik Hovland <erik@…> 16 years ago.
check this before dereferencing it

Download all attachments as: .zip

Change History (3)

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

check this before dereferencing it

comment:1 Changed 16 years ago by Isaac Richards

Milestone: 0.210.22

comment:2 Changed 16 years ago by danielk

Resolution: fixed
Status: newclosed

(In [16438]) Fixes #4844. Fixes some broken printerr() macros in dvdnav that produced segfaults on some DVD error conditions.

Note: See TracTickets for help on using tickets.