Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 857bf52

Browse files
committed
aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for buffer
overrun avoidance.
1 parent 5947af5 commit 857bf52

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/dynload_aix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ aix_loaderror(const char *pathname)
146146
#define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0]))
147147
#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1)
148148

149-
sprintf(errbuf, "from module %.200s ", pathname);
149+
PyOS_snprintf(errbuf, sizeof(errbuf), "from module %.200s ", pathname);
150150

151151
if (!loadquery(L_GETMESSAGES, &message[0], sizeof(message))) {
152152
ERRBUF_APPEND(strerror(errno));

0 commit comments

Comments
 (0)