Repository navigation
URL/NUL normalizer (TASKS 1.4) - #21
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/core/ig_normalize.{h,c}:ig_url_decode()— one round:%XX,%uXXXX→ UTF-8 (surrogates kept),+→ space only withIG_DECODE_PLUS; invalid/truncated sequences copied as is (like PHP). Output never longer than input; in-place allowed.ig_normalize()— up toroundsrounds (inletguard.decode_rounds, default 2, on top of PHP's own decode), each followed by NUL removal (so%%0041→%41→A); stops when stable; stats:rounds,nul_removed,limit_hit(still decodable after the last round — input for the anomaly class later).IG_NORM_ERRORon NULL buffers.fuzz_normalize(output ≤ input, no NUL, in-place = separate buffer) with seeds.Verified locally: unit (gcc, clang + ASan/UBSan, CentOS 7 gcc 4.8.5), clang-tidy, cppcheck, clang-format, phpt 7.0/8.5 ZTS, 30 s fuzzing per target (2.4M executions for the normalizer).
TDD
a8f3f77:tests/unit/test_normalize.c(12 tests).🤖 Generated with Claude Code