From: Barry Warsaw Date: Wed, 28 Nov 2001 21:35:49 +0000 (+0000) Subject: aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for buffer X-Git-Tag: v2.2.1c1~663 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=857bf52d56e1508be783d7f7e11a9d6783aadb20;p=python aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. --- diff --git a/Python/dynload_aix.c b/Python/dynload_aix.c index 4467c70414..4e39c31d43 100644 --- a/Python/dynload_aix.c +++ b/Python/dynload_aix.c @@ -146,7 +146,7 @@ aix_loaderror(const char *pathname) #define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0])) #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))) { ERRBUF_APPEND(strerror(errno));