Skip to content

Parse the wizard reply with a bounded integer parser - #2096

Open
xroche wants to merge 2 commits into
masterfrom
fz/B15
Open

xroche wants to merge 2 commits into
masterfrom
fz/B15

Conversation

@xroche

@xroche xroche commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Parses the wizard reply with a bounded integer parser, so a reply above INT_MAX is refused as unreadable (-999) instead of wrapping into another code. The refusal is logged once, with the URL, by the existing (wizard) could not read your answer warning, and no longer printed to stdout.

A reply such as 5abc still parses as 5, and +5 or 5 stay unreadable, as before. Test 758 checks the parser and crawls with the reply 4294967297, which sscanf("%d") turned into 1.

xroche and others added 2 commits November 7, 2026 18:46
A reply above INT_MAX wrapped through sscanf into another wizard code.
It now reads as unreadable (-999). The message goes to the log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
apply_verdict already logs the unreadable reply with its URL, so the
call-site warning is removed. Test 758 now crawls with an oversized
reply and checks the log line and that stdout stays quiet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche enabled auto-merge (squash) November 7, 2026 18:54
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.

1 participant