]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: fix potentially uninitialized local variable warnings
authorDaniel Stenberg <daniel@haxx.se>
Mon, 12 Jun 2023 21:17:33 +0000 (23:17 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 13 Jun 2023 06:29:25 +0000 (08:29 +0200)
Follow-up from a4a5e438ae533c

Closes #11310

lib/vtls/vtls.c

index bdc25919d0751543ec8550ae6ccc7ebcbab0d100..d905f02c99f31406ac87aaf75f311163fde75c79 100644 (file)
@@ -893,8 +893,8 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
   /* only do this if pinnedpubkey starts with "sha256//", length 8 */
   if(strncmp(pinnedpubkey, "sha256//", 8) == 0) {
     CURLcode encode;
-    size_t encodedlen, pinkeylen;
-    char *encoded, *pinkeycopy, *begin_pos, *end_pos;
+    size_t encodedlen = 0, pinkeylen;
+    char *encoded = NULL, *pinkeycopy, *begin_pos, *end_pos;
     unsigned char *sha256sumdigest;
 
     if(!Curl_ssl->sha256sum) {