[mythtv-commits] Ticket #2607: potential NULL dereference in dbox2recorder.cpp

MythTV mythtv at cvs.mythtv.org
Tue Oct 24 04:20:19 UTC 2006


#2607: potential NULL dereference in dbox2recorder.cpp
--------------------------+-------------------------------------------------
 Reporter:  jim at jtan.com  |       Owner:  ijr    
     Type:  defect        |      Status:  new    
 Priority:  minor         |   Milestone:  unknown
Component:  mythtv        |     Version:  head   
 Severity:  low           |  
--------------------------+-------------------------------------------------
 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.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/2607>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list