squid icon indicating copy to clipboard operation
squid copied to clipboard

FTP: More EPLF 'm' timestamp parsing fixes

Open MegaManSec opened this issue 4 months ago • 3 comments

The m case in ftpListParseParts() reversed the strtol() validity check. We broke out when any digits were consumed instead of only when no conversion happened. As a result, valid epoch timestamps were treated as invalid and p->date was often left unset.

Also guard against ctime() returning nil and avoid null pointer dereference if no newline is present in ctime() output.

Also reject m entries with trailing garbage.

MegaManSec avatar Sep 07 '25 23:09 MegaManSec

Cannot create a git commit message from PR title and description.

Error while parsing future commit message title: the line is too long 73>72

Problematic parser input:

FtpGateway: fix 'm' timestamp parsing; guard ctime(); trim safely (#2207)

Please see PR title and description formatting requirements for more details.

This message was added by Anubis bot. Anubis will add a new message if the error text changes. Anubis will remove M-failed-description label when there are no corresponding failures to report.

squid-anubis avatar Sep 07 '25 23:09 squid-anubis

run this PR through the tests

Done, no problems were found.

eduard-bagdasaryan avatar Sep 18 '25 16:09 eduard-bagdasaryan

I adjusted PR description a little to mention trailing garbage handling and to avoid retelling the fairly clear diff when it comes to strstr() refactoring. I am not against adding some text about that refactoring though.

rousskov avatar Oct 31 '25 21:10 rousskov