]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[2.7] bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) ...
authorZackery Spytz <zspytz@gmail.com>
Mon, 22 Apr 2019 23:35:55 +0000 (17:35 -0600)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 22 Apr 2019 23:35:55 +0000 (16:35 -0700)
(cherry picked from commit 56ed86490cb8221c874d432461d77702437f63e5)

https://bugs.python.org/issue9194

PC/_winreg.c

index f0f8df33107bea9d2af8c4a7668eb076b3bc3d64..3b887e075334be62ddf4baea2c6c6efc02ba38d4 100644 (file)
@@ -727,7 +727,7 @@ fixupMultiSZ(char **str, char *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++)
             ;
     }
 }