From: Henrik Holst Date: Thu, 10 Feb 2022 17:47:08 +0000 (+0100) Subject: mprintf: remove strlen calls on empty strings in dprintf_formatf X-Git-Tag: curl-7_82_0~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=186340c9cd02ae383bc6b39c353ad5317d4ee574;p=thirdparty%2Fcurl.git mprintf: remove strlen calls on empty strings in dprintf_formatf Turns out that in dprintf_formatf we did a strlen on empty strings, a bit strange is how common this actually is, 24 alone when doing a simple GET from https://curl.se Closes #8427 --- diff --git a/lib/mprintf.c b/lib/mprintf.c index b109379bf2..13812010b3 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -829,6 +829,8 @@ static int dprintf_formatf( } else if(prec != -1) len = (size_t)prec; + else if(*str == '\0') + len = 0; else len = strlen(str);