]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
rustls: typecast variable for safer trace output
authorDaniel Stenberg <daniel@haxx.se>
Sat, 20 Sep 2025 09:17:48 +0000 (11:17 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 20 Sep 2025 10:07:10 +0000 (12:07 +0200)
This is a variadic function call with a mismatched argument type; on
platforms where uintptr_t and size_t differ, this invokes undefined
behavior.

Reported in Joshua's sarif data

Closes #18628

lib/vtls/rustls.c

index 905d4f8a99e32e58d417330773abaa41745e1024..e5d85aa38f383d9a9c13061b2d639feed1ebdd5d 100644 (file)
@@ -121,7 +121,7 @@ read_cb(void *userdata, uint8_t *buf, uintptr_t len, uintptr_t *out_n)
     connssl->peer_closed = TRUE;
   *out_n = (uintptr_t)nread;
   CURL_TRC_CF(io_ctx->data, io_ctx->cf, "cf->next recv(len=%zu) -> %d, %zu",
-              len, result, nread);
+              (size_t)len, result, nread);
   return ret;
 }