mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Skip Montanaro: add string precisions to calls to PyErr_Format
to prevent possible buffer overruns.
This commit is contained in:
parent
fa972c987c
commit
5db862dd0c
5 changed files with 29 additions and 27 deletions
|
@ -2513,7 +2513,7 @@ call_function(func, arg, kw)
|
|||
else {
|
||||
if (!PyFunction_Check(func)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"call of non-function (type %s)",
|
||||
"call of non-function (type %.200s)",
|
||||
func->ob_type->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,9 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
|||
if (!NSIsSymbolNameDefined(funcname)) {
|
||||
/* UnlinkModule() isn't implimented in current versions, but calling it does no harm */
|
||||
NSUnLinkModule(newModule, FALSE);
|
||||
PyErr_Format(PyExc_ImportError, "Loaded module does not contain symbol %s", funcname);
|
||||
PyErr_Format(PyExc_ImportError,
|
||||
"Loaded module does not contain symbol %.200s",
|
||||
funcname);
|
||||
return NULL;
|
||||
}
|
||||
theSym = NSLookupAndBindSymbol(funcname);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue