]> granicus.if.org Git - python/commitdiff
bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687)
authorZackery Spytz <zspytz@gmail.com>
Mon, 22 Apr 2019 17:01:32 +0000 (11:01 -0600)
committerSteve Dower <steve.dower@microsoft.com>
Mon, 22 Apr 2019 17:01:32 +0000 (10:01 -0700)
PC/winreg.c

index ae0c292b7172e9a0e81ce9c5fdf588d194508a37..28b316ae2f4cb97f623bdde34e71a19ad8d5897b 100644 (file)
@@ -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++)
             ;
     }
 }