Skip to content

Commit 7e2d47d

Browse files
committed
curl: change uses of sprintf into snprintf
1 parent 8c92b5f commit 7e2d47d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/curl/interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ PHP_MINFO_FUNCTION(curl)
257257
php_info_print_table_start();
258258
php_info_print_table_row(2, "cURL support", "enabled");
259259
php_info_print_table_row(2, "cURL Information", d->version);
260-
sprintf(str, "%d", d->age);
260+
snprintf(str, sizeof(str), "%d", d->age);
261261
php_info_print_table_row(2, "Age", str);
262262

263263
/* To update on each new cURL release using src/main.c in cURL sources */
@@ -324,7 +324,7 @@ PHP_MINFO_FUNCTION(curl)
324324
n = 0;
325325
p = (char **) d->protocols;
326326
while (*p != NULL) {
327-
n += sprintf(str + n, "%s%s", *p, *(p + 1) != NULL ? ", " : "");
327+
n += snprintf(str + n, sizeof(str) - n, "%s%s", *p, *(p + 1) != NULL ? ", " : "");
328328
p++;
329329
}
330330
php_info_print_table_row(2, "Protocols", str);

0 commit comments

Comments
 (0)