mirror of
https://github.com/curl/curl.git
synced 2026-05-30 13:47:28 +03:00
telnet: handle single-byte input option
Coverity CID 1638753 correctly identies this code misbehaved if the passed in suboption is exactly one byte long by substracting two from the unsigned size_t variable. Closes #15987
This commit is contained in:
parent
81a25ba7a4
commit
02ba03938f
1 changed files with 4 additions and 1 deletions
|
|
@ -695,7 +695,10 @@ static void printsub(struct Curl_easy *data,
|
|||
infof(data, ", not IAC SE) ");
|
||||
}
|
||||
}
|
||||
length -= 2;
|
||||
if(length >= 2)
|
||||
length -= 2;
|
||||
else /* bad input */
|
||||
return;
|
||||
}
|
||||
if(length < 1) {
|
||||
infof(data, "(Empty suboption?)");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue