Skip to content
Permalink
Browse files Browse the repository at this point in the history
telnet: check sscanf() for correct number of matches
  • Loading branch information
Harry Sintonen authored and bagder committed May 24, 2021
1 parent bbb7150 commit 39ce47f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/telnet.c
Expand Up @@ -922,7 +922,7 @@ static void suboption(struct Curl_easy *data)
size_t tmplen = (strlen(v->data) + 1);
/* Add the variable only if it fits */
if(len + tmplen < (int)sizeof(temp)-6) {
if(sscanf(v->data, "%127[^,],%127s", varname, varval)) {
if(sscanf(v->data, "%127[^,],%127s", varname, varval) == 2) {
msnprintf((char *)&temp[len], sizeof(temp) - len,
"%c%s%c%s", CURL_NEW_ENV_VAR, varname,
CURL_NEW_ENV_VALUE, varval);
Expand Down

0 comments on commit 39ce47f

Please sign in to comment.