mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for buffer
overrun avoidance.
This commit is contained in:
parent
5947af5ac3
commit
857bf52d56
1 changed files with 1 additions and 1 deletions
|
@ -146,7 +146,7 @@ aix_loaderror(const char *pathname)
|
||||||
#define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0]))
|
#define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0]))
|
||||||
#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1)
|
#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1)
|
||||||
|
|
||||||
sprintf(errbuf, "from module %.200s ", pathname);
|
PyOS_snprintf(errbuf, sizeof(errbuf), "from module %.200s ", pathname);
|
||||||
|
|
||||||
if (!loadquery(L_GETMESSAGES, &message[0], sizeof(message))) {
|
if (!loadquery(L_GETMESSAGES, &message[0], sizeof(message))) {
|
||||||
ERRBUF_APPEND(strerror(errno));
|
ERRBUF_APPEND(strerror(errno));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue