]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: fix missing multissl version info
authorJay Satiro <raysatiro@yahoo.com>
Wed, 27 Dec 2023 00:08:48 +0000 (19:08 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Wed, 27 Dec 2023 22:49:27 +0000 (17:49 -0500)
- Fix erroneous buffer copy logic from ff74cef5.

Prior to this change the MultiSSL version info returned to the user
was empty.

Closes https://github.com/curl/curl/pull/12599

lib/vtls/vtls.c

index 256b8faa804f99556886baff49a0e88247da3ca6..7f6ce09d7cf9614f4259112e4fd46aea8c8600e7 100644 (file)
@@ -1413,10 +1413,12 @@ static size_t multissl_version(char *buffer, size_t size)
     backends_len = p - backends;
   }
 
-  if(size && (size < backends_len))
-    strcpy(buffer, backends);
-  else
-    *buffer = 0; /* did not fit */
+  if(size) {
+    if(backends_len < size)
+      strcpy(buffer, backends);
+    else
+      *buffer = 0; /* did not fit */
+  }
   return 0;
 }