]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 22 Apr 2019 17:20:33 +0000 (10:20 -0700)
committerGitHub <noreply@github.com>
Mon, 22 Apr 2019 17:20:33 +0000 (10:20 -0700)
(cherry picked from commit 56ed86490cb8221c874d432461d77702437f63e5)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
PC/winreg.c

index e3801b257b071e74285bb2fd006c0dfc49f2f8ee..96dd4ef059be93f0c869abc70a9a2761e669f6e4 100644 (file)
@@ -520,7 +520,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++)
             ;
     }
 }