classification
Title: winreg:fixupMultiSZ should check that P < Q in the inner loop
Type: behavior Stage: test needed
Components: Extension Modules, Windows Versions: Python 3.2, Python 3.1, Python 2.7, Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, stutzbach
Priority: normal Keywords:

Created on 2010-07-08 03:06 by stutzbach, last changed 2010-07-08 05:19 by ezio.melotti.

Messages (1)
msg109511 - (view) Author: Daniel Stutzbach (stutzbach) (Python committer) Date: 2010-07-08 03:06
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++)
                        ;
History
Date User Action Args
2010-07-08 05:19:25ezio.melottisetnosy: + brian.curtin

type: behavior
components: + Extension Modules, Windows
stage: test needed
2010-07-08 03:06:45stutzbachcreate