← Commit list

3b4bf3fcfa

Daniel Stenberg
Daniel Stenberg
2025-11-12
SUCCESS Duration: 148s

Subject

telnet: replace atoi for BINARY handling with curlx_str_number

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/telnet.c+4 -2
@@ -895,8 +895,10 @@ static CURLcode check_telnet_options(struct Curl_easy *data,
case 6:
/* To take care or not of the 8th bit in data exchange */
if(curl_strnequal(option, "BINARY", 6)) {
- int binary_option = atoi(arg);
- if(binary_option != 1) {
+ const char *p = arg;
+ curl_off_t binary_option;
+ if(!curlx_str_number(&p, &binary_option, 1) &&
+ (binary_option != 1)) {
tn->us_preferred[CURL_TELOPT_BINARY] = CURL_NO;
tn->him_preferred[CURL_TELOPT_BINARY] = CURL_NO;
}