]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) (GH-12910)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 2 May 2019 16:00:33 +0000 (09:00 -0700)
committerNed Deily <nad@python.org>
Thu, 2 May 2019 16:00:33 +0000 (12:00 -0400)
(cherry picked from commit 56ed86490cb8221c874d432461d77702437f63e5)

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

index 3fde04d746b53c287a2d0e283437f59c16acd6b1..5739cf43335aa3b9049ee826f2d03235c82533e8 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++)
             ;
     }
 }