Opened 18 years ago
Closed 18 years ago
#766 closed defect (fixed)
potentially unsafe while loop in mythdialogs.cpp
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | trivial | Milestone: | unknown |
Component: | mythtv | Version: | |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
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.
proposed patch