diff options
author | Barry Warsaw <barry@python.org> | 2001-11-28 21:03:37 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-11-28 21:03:37 (GMT) |
commit | 58ab084ac6094f3201169dd6c5259b6bd99e4926 (patch) | |
tree | 2661e3b33010abd6ac9415eb4e3886d201b422c0 /PC/import_nt.c | |
parent | d586756dc5ef15688fb21edef98664509aeaae4a (diff) | |
download | cpython-58ab084ac6094f3201169dd6c5259b6bd99e4926.zip cpython-58ab084ac6094f3201169dd6c5259b6bd99e4926.tar.gz cpython-58ab084ac6094f3201169dd6c5259b6bd99e4926.tar.bz2 |
PyWin_FindRegisteredModule(): Conversion of sprintf() to
PyOS_snprintf() for buffer overrun avoidance.
Diffstat (limited to 'PC/import_nt.c')
-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 58cd9e4..f937df8 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); |