[mythtv-commits] Ticket #766: potentially unsafe while loop in mythdialogs.cpp

MythTV mythtv at cvs.mythtv.org
Tue Dec 6 18:21:32 EST 2005


#766: potentially unsafe while loop in mythdialogs.cpp
-------------------------------+--------------------------------------------
 Reporter:  mythtv at hburch.com  |       Owner:  ijr
     Type:  defect             |      Status:  new
 Priority:  trivial            |   Milestone:     
Component:  mythtv             |     Version:     
 Severity:  low                |  
-------------------------------+--------------------------------------------
 MythDialog::assignFirstFocus iterates over focus_taking_widgets with a
 while loop, stopping at the first one that canTakeFocus().  Unfortunately,
 the while loop never actually advances.  Fortunately, focus_taking_widgets
 should only contain widgets that canTakeFocus() (at least, based on the
 name).

 Although this is not causing any operational issues to my knowledge (and I
 think someone would have noticed), having a while loop there that is a
 potential infinite loop is probably wrong.

 My patch advances the iterator each pass through the while () loop.  You
 could, alternatively, just trust that the first one will work (which the
 current code does), but it should not infinite loop if that's not the
 caes.

-- 
Ticket URL: <http://cvs.mythtv.org/trac/ticket/766>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list