Opened 18 years ago

Closed 18 years ago

#766 closed defect (fixed)

potentially unsafe while loop in mythdialogs.cpp

Reported by: mythtv@… 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.

Attachments (1)

iterator-poss.patch (692 bytes) - added by mythtv@… 18 years ago.
proposed patch

Download all attachments as: .zip

Change History (2)

Changed 18 years ago by mythtv@…

Attachment: iterator-poss.patch added

proposed patch

comment:1 Changed 18 years ago by Isaac Richards

Resolution: fixed
Status: newclosed

(In [8183]) Close #766 by applying patch.

Note: See TracTickets for help on using tickets.