]> granicus.if.org Git - python/commitdiff
aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for buffer
authorBarry Warsaw <barry@python.org>
Wed, 28 Nov 2001 21:35:49 +0000 (21:35 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 28 Nov 2001 21:35:49 +0000 (21:35 +0000)
overrun avoidance.

Python/dynload_aix.c

index 4467c70414fb3a44cfb6dfb4d2749f2378efae89..4e39c31d43f3082d8974041f7e796b9395c1cfee 100644 (file)
@@ -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));