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
This commit is contained in:
Jay Satiro 2023-12-26 19:08:48 -05:00
parent f111603176
commit e251e858b9

View 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;
}