mirror of
https://github.com/python/cpython.git
synced 2024-11-26 11:24:40 +08:00
PyWin_FindRegisteredModule(): Conversion of sprintf() to
PyOS_snprintf() for buffer overrun avoidance.
This commit is contained in:
parent
d586756dc5
commit
58ab084ac6
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user