Opened 17 years ago

Closed 17 years ago

#2607 closed defect (fixed)

potential NULL dereference in dbox2recorder.cpp

Reported by: jim@… Owned by: danielk
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

Spotted while looking through the code: in DBox2Recorder::OpenStream?(), if

    struct hostent * hp = gethostbyname(ip);

fails, it will set hp = NULL. A few lines down:

    adr.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr;

which will then dereference it. Untested patch attached.

Attachments (1)

hp.patch (482 bytes) - added by jim@… 17 years ago.

Download all attachments as: .zip

Change History (3)

Changed 17 years ago by jim@…

Attachment: hp.patch added

comment:1 Changed 17 years ago by danielk

Milestone: unknown0.21
Owner: changed from Isaac Richards to danielk

comment:2 Changed 17 years ago by danielk

Resolution: fixed
Status: newclosed

(In [11613]) Fixes #2607. Adds check for null before dereference in DBOX2 Recorder, problem discovered by jim at jtan com.

Note: See TracTickets for help on using tickets.