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! * also no heap fragmentation!
*/ */
moduleKey = alloca(bufSize); moduleKey = alloca(bufSize);
sprintf(moduleKey, PyOS_snprintf(moduleKey, bufSize,
"Software\\Python\\PythonCore\\%s\\Modules\\%s%s", "Software\\Python\\PythonCore\\%s\\Modules\\%s%s",
PyWin_DLLVersionString, moduleName, debugString); PyWin_DLLVersionString, moduleName, debugString);
modNameSize = pathLen; modNameSize = pathLen;
regStat = RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize); regStat = RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize);