]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: when using printf %.*s, the length arg must be 'int'
authorDaniel Stenberg <daniel@haxx.se>
Mon, 2 Jan 2023 11:53:45 +0000 (12:53 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 Jan 2023 12:24:37 +0000 (13:24 +0100)
Detected by Coverity CID 1518341

Closes #10203

lib/http2.c

index 95ffb0996bb5658bb43df0998121a3082ca414dc..d170adf84f9478916e23df8ca90f89f22bbfa69f 100644 (file)
@@ -1155,11 +1155,11 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
 
   if(stream->bodystarted) {
     /* This is a trailer */
-    H2BUGF(infof(data_s, "h2 trailer: %.*s: %.*s", namelen, name, valuelen,
-                 value));
+    H2BUGF(infof(data_s, "h2 trailer: %.*s: %.*s", (int)namelen, name,
+                 (int)valuelen, value));
     result = Curl_dyn_addf(&stream->trailer_recvbuf,
-                           "%.*s: %.*s\r\n", namelen, name,
-                           valuelen, value);
+                           "%.*s: %.*s\r\n", (int)namelen, name,
+                           (int)valuelen, value);
     if(result)
       return NGHTTP2_ERR_CALLBACK_FAILURE;
 
@@ -1217,8 +1217,8 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
   if(get_transfer(ctx) != data_s)
     Curl_expire(data_s, 0, EXPIRE_RUN_NOW);
 
-  H2BUGF(infof(data_s, "h2 header: %.*s: %.*s", namelen, name, valuelen,
-               value));
+  H2BUGF(infof(data_s, "h2 header: %.*s: %.*s", (int)namelen, name,
+               (int)valuelen, value));
 
   return 0; /* 0 is successful */
 }