From: Jay Satiro Date: Wed, 27 Dec 2023 00:08:48 +0000 (-0500) Subject: vtls: fix missing multissl version info X-Git-Tag: curl-8_6_0~168 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e251e858b941e29bb95a6c0d26bb45981a872585;p=thirdparty%2Fcurl.git vtls: fix missing multissl version info - 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 --- diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 256b8faa80..7f6ce09d7c 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -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; }