PyWin_FindRegisteredModule(): Conversion of sprintf() to

PyOS_snprintf() for buffer overrun avoidance.
This commit is contained in:
Barry Warsaw 2001-11-28 21:03:37 +00:00
parent d586756dc5
commit 58ab084ac6

View file

@ -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);