diff options
| author | Barry Warsaw <barry@python.org> | 2001-11-28 21:03:37 +0000 |
|---|---|---|
| committer | Barry Warsaw <barry@python.org> | 2001-11-28 21:03:37 +0000 |
| commit | 58ab084ac6094f3201169dd6c5259b6bd99e4926 (patch) | |
| tree | 2661e3b33010abd6ac9415eb4e3886d201b422c0 | |
| parent | d586756dc5ef15688fb21edef98664509aeaae4a (diff) | |
| download | cpython-git-58ab084ac6094f3201169dd6c5259b6bd99e4926.tar.gz | |
PyWin_FindRegisteredModule(): Conversion of sprintf() to
PyOS_snprintf() for buffer overrun avoidance.
| -rw-r--r-- | PC/import_nt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/PC/import_nt.c b/PC/import_nt.c index 58cd9e4850..f937df86bc 100644 --- a/PC/import_nt.c +++ b/PC/import_nt.c @@ -49,9 +49,9 @@ FILE *PyWin_FindRegisteredModule(const char *moduleName, * also no heap fragmentation! */ moduleKey = alloca(bufSize); - sprintf(moduleKey, - "Software\\Python\\PythonCore\\%s\\Modules\\%s%s", - PyWin_DLLVersionString, moduleName, debugString); + PyOS_snprintf(moduleKey, bufSize, + "Software\\Python\\PythonCore\\%s\\Modules\\%s%s", + PyWin_DLLVersionString, moduleName, debugString); modNameSize = pathLen; regStat = RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize); |
