parent
0c28ba2faa
commit
e4f93be9d5
15
lib/telnet.c
15
lib/telnet.c
@ -841,10 +841,19 @@ static CURLcode check_telnet_options(struct Curl_easy *data)
|
|||||||
case 2:
|
case 2:
|
||||||
/* Window Size */
|
/* Window Size */
|
||||||
if(strncasecompare(option, "WS", 2)) {
|
if(strncasecompare(option, "WS", 2)) {
|
||||||
if(sscanf(arg, "%hu%*[xX]%hu",
|
char *p;
|
||||||
&tn->subopt_wsx, &tn->subopt_wsy) == 2)
|
unsigned long x = strtoul(arg, &p, 10);
|
||||||
|
unsigned long y = 0;
|
||||||
|
if(Curl_raw_tolower(*p) == 'x') {
|
||||||
|
p++;
|
||||||
|
y = strtoul(p, NULL, 10);
|
||||||
|
if(x && y && (x <= 0xffff) && (y <= 0xffff)) {
|
||||||
|
tn->subopt_wsx = (unsigned short)x;
|
||||||
|
tn->subopt_wsy = (unsigned short)y;
|
||||||
tn->us_preferred[CURL_TELOPT_NAWS] = CURL_YES;
|
tn->us_preferred[CURL_TELOPT_NAWS] = CURL_YES;
|
||||||
else {
|
}
|
||||||
|
}
|
||||||
|
if(!y) {
|
||||||
failf(data, "Syntax error in telnet option: %s", head->data);
|
failf(data, "Syntax error in telnet option: %s", head->data);
|
||||||
result = CURLE_SETOPT_OPTION_SYNTAX;
|
result = CURLE_SETOPT_OPTION_SYNTAX;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user