]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_debug_cb: do not assume zero-terminated data
authorDaniel Stenberg <daniel@haxx.se>
Tue, 3 Nov 2020 07:14:46 +0000 (08:14 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 3 Nov 2020 07:14:46 +0000 (08:14 +0100)
Follow-up to d70a5b5a0f5e3

src/tool_cb_dbg.c

index 1c42db8a558a9137174d369d6f23fa1eb3015029..69b459873c349b997b5a0d16c5c0fb0a4a2c6711 100644 (file)
@@ -187,7 +187,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
 
   switch(type) {
   case CURLINFO_TEXT:
-    fprintf(output, "%s== Info: %s", timebuf, data);
+    fprintf(output, "%s== Info: %.*s", timebuf, (int)size, data);
     /* FALLTHROUGH */
   default: /* in case a new one is introduced to shock us */
     return 0;