Skip to content

Improve parsing of certain FTP directory listing formats (#2408)#2409

Merged
yadij merged 2 commits into
squid-cache:v7from
squidadm:v7-backport-pr2408
May 17, 2026
Merged

Improve parsing of certain FTP directory listing formats (#2408)#2409
yadij merged 2 commits into
squid-cache:v7from
squidadm:v7-backport-pr2408

Conversation

@squidadm
Copy link
Copy Markdown
Collaborator

This surgical fix restricts parsing to the input buffer when the listing
entry date in "TypeA" or "TypeB" formats is not followed by a filename.
It does not improve rendering of listings with missing filenames or the
overall quality of FTP listing parsing code.

C strchr() always returns a non-nil pointer when given a NUL character,
so its callers must be careful not to supply a NUL character if a
"natural" one-of-the-regular-c-string-characters membership test is
required.

The bug was probably introduced in 1997 commit 3fdadc7 and then
duplicated in 2017 commit 3d87209.

…#2408)

This surgical fix restricts parsing to the input buffer when the listing
entry date in "TypeA" or "TypeB" formats is not followed by a filename.
It does not improve rendering of listings with missing filenames or the
overall quality of FTP listing parsing code.

C strchr() always returns a non-nil pointer when given a NUL character,
so its callers must be careful not to supply a NUL character if a
"natural" one-of-the-regular-c-string-characters membership test is
required.

The bug was probably introduced in 1997 commit 3fdadc7 and then
duplicated in 2017 commit 3d87209.
@yadij yadij merged commit 865a131 into squid-cache:v7 May 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants