[mythtv-commits] Ticket #2278: Prevent overstepping list boundaries in ParseGeometryOverride

MythTV mythtv at cvs.mythtv.org
Wed Aug 30 19:20:57 UTC 2006

#2278: Prevent overstepping list boundaries in ParseGeometryOverride
 Reporter:  sphery <mtdean at thirdcontact.com>  |       Owner:  ijr
     Type:  patch                             |      Status:  new
 Priority:  minor                             |   Milestone:     
Component:  mythtv                            |     Version:     
 Severity:  medium                            |  
 In the event that a user specifies the -geometry or --geometry option to
 mythfrontend or mythtv-setup using the WxH format (not the WxH+X+Y
 format), MythContext::ParseGeometryOverride() oversteps the boundaries of
 the QStringList geo.  The results of such behavior is undefined by QT, but
 generally seems to just log a warning:

 ASSERT: "i <= nodes" in /usr/qt/include/qvaluelist.h (372)

 in the mythfrontend/mythtv-setup logs and m_geometry_x and m_geometry_y
 either remain at their defaults or are set to 0 due to a failed parsing
 (not sure which way it happens, but the values end up being 0).

 The attached patch fixes ParseGeometryOverride() to check whether the
 width and height were specified before attempting to parse them.  As
 before the patch, ParseGeometryOverride() continues to use the same
 default values for X and Y location (0,0), not the values specified for
 GuiOffsetX and GuiOffsetY in the database.  If you feel it makes more
 sense to use the GUI settings, instead, please let me know.

 The section of code which oversteps the boundaries is not critical
 (because of the defaults/resolving to 0, which happens to be a good
 default).  So, for all practical purposes, it's simply checking to verify
 that the values can be parsed as ints so it can log messages in the event
 of failure.  However, due to the regex's that verify the format, I can't
 see a way the error messages could be triggered (as we'll return with an
 error if the format is wrong), so there were never any bug reports issued
 about this behavior.  I fixed it mainly to get rid of the annoying

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

More information about the mythtv-commits mailing list