[mythtv-commits] Ticket #7159: Giving strerror a negative value is usually a bad idea

MythTV mythtv at cvs.mythtv.org
Fri Sep 25 16:50:27 UTC 2009


#7159: Giving strerror a negative value is usually a bad idea
---------------------------------------------+------------------------------
 Reporter:  Erik Hovland <erik at hovland.org>  |       Owner:  ijr    
     Type:  defect                           |      Status:  new    
 Priority:  trivial                          |   Milestone:  unknown
Component:  MythTV - General                 |     Version:  head   
 Severity:  low                              |     Mlocked:  0      
---------------------------------------------+------------------------------
 strerror() has undefined behavior when given a value that is negative. In
 the sound code there is an idiom where the error message uses strerror()
 w/ the return value of the ioctl(). I understand that the ioctl() in this
 case might return the error. But since that error also has to be negative
 according to the check of the value, this might cause problems (like
 segfaults). If this is actually what the author wants, they should flip
 the sign of the return value before giving it to strerror().

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


More information about the mythtv-commits mailing list