CURLOPT_DEBUGFUNCTION.3: do not assume nul-termination in example

Reported-by: Oskar Sigvardsson

Bug: https://curl.se/mail/lib-2022-11/0016.html

Closes #9862
This commit is contained in:
Daniel Stenberg 2022-11-07 12:15:24 +01:00
parent af5a22a9c1
commit ec4eec222b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -125,7 +125,8 @@ int my_trace(CURL *handle, curl_infotype type,
switch (type) {
case CURLINFO_TEXT:
fprintf(stderr, "== Info: %s", data);
fputs("== Info: ", stderr);
fwrite(data, size, 1, stderr);
default: /* in case a new one is introduced to shock us */
return 0;