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

Miss Islington (bot) webhook-mailer at python.org
Mon Apr 22 19:36:01 EDT 2019


https://github.com/python/cpython/commit/84efbaecaf50b771cc7a95fd9dd9602bd31de305
commit: 84efbaecaf50b771cc7a95fd9dd9602bd31de305
branch: 2.7
author: Zackery Spytz <zspytz at gmail.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-04-22T16:35:55-07:00
summary:

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



(cherry picked from commit 56ed86490cb8221c874d432461d77702437f63e5)



https://bugs.python.org/issue9194

files:
M PC/_winreg.c

diff --git a/PC/_winreg.c b/PC/_winreg.c
index f0f8df33107b..3b887e075334 100644
--- a/PC/_winreg.c
+++ b/PC/_winreg.c
@@ -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++)
             ;
     }
 }



More information about the Python-checkins mailing list