[New-bugs-announce] [issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop

Daniel Stutzbach report at bugs.python.org
Thu Jul 8 05:06:47 CEST 2010


New submission from Daniel Stutzbach <daniel at stutzbachenterprises.com>:

The comment before fixupMultiSZ and countString states:

** Note that fixupMultiSZ and countString have both had changes
** made to support "incorrect strings".  The registry specification
** calls for strings to be terminated with 2 null bytes.  It seems
** some commercial packages install strings which don't conform,
** causing this code to fail - however, "regedit" etc still work
** with these strings (ie only we don't!).

As indicated in the comments, the two functions dutifully check the supplied length parameter and do not trust the data to be in the correct format.

... except for the inner loop in fixupMultiSZ, which reads:

                for(; *P != '\0'; P++)
                        ;

It should be the same as the inner loop of countStrings:

                for (; P < Q && *P != '\0'; P++)
                        ;

----------
messages: 109511
nosy: stutzbach
priority: normal
severity: normal
status: open
title: winreg:fixupMultiSZ should check that P < Q in the inner loop
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9194>
_______________________________________


More information about the New-bugs-announce mailing list