Fix a potential buffer overflow bug in lib/version.c

This commit is contained in:
Patrick Monnerat 2007-08-15 14:49:16 +00:00
parent e5d8693865
commit ca410ec2ca
1 changed files with 3 additions and 2 deletions

View File

@ -57,8 +57,9 @@ char *curl_version(void)
size_t len;
size_t left = sizeof(version);
strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION );
ptr=strchr(ptr, '\0');
left -= strlen(ptr);
len = strlen(ptr);
left -= len;
ptr += len;
len = Curl_ssl_version(ptr, left);
left -= len;