[Python-checkins] bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687)

Steve Dower webhook-mailer at python.org
Mon Apr 22 13:01:50 EDT 2019


https://github.com/python/cpython/commit/56ed86490cb8221c874d432461d77702437f63e5
commit: 56ed86490cb8221c874d432461d77702437f63e5
branch: master
author: Zackery Spytz <zspytz at gmail.com>
committer: Steve Dower <steve.dower at microsoft.com>
date: 2019-04-22T10:01:32-07:00
summary:

bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687)

files:
M PC/winreg.c

diff --git a/PC/winreg.c b/PC/winreg.c
index ae0c292b7172..28b316ae2f4c 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -521,7 +521,7 @@ fixupMultiSZ(wchar_t **str, wchar_t *data, int len)
     Q = data + len;
     for (P = data, i = 0; P < Q && *P != '\0'; P++, i++) {
         str[i] = P;
-        for(; *P != '\0'; P++)
+        for (; P < Q && *P != '\0'; P++)
             ;
     }
 }



More information about the Python-checkins mailing list