ftp: fix the 213 scanner memchr buffer limit argument

Reported-by: Joshua Rogers
Closes #18867
This commit is contained in:
Daniel Stenberg 2025-10-06 09:54:39 +02:00
parent 2f3cf17e33
commit 9e3c35a88e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -2319,7 +2319,7 @@ static CURLcode ftp_state_size_resp(struct Curl_easy *data,
for all the digits at the end of the response and parse only those as a
number. */
char *start = &buf[4];
const char *fdigit = memchr(start, '\r', len);
const char *fdigit = memchr(start, '\r', len - 4);
if(fdigit) {
fdigit--;
if(*fdigit == '\n')