Closed Skgland closed 8 months ago
Its also probably not ideal tha the fixed code and the test are in different crates, but I didn't know how to separate the punycode from the url and how to add a test in the punycode crate as that appears to use a custom testing framework
not sure if #870 is completely resolved as there are other comments indicating a possible overflow condition that I did not understand and as such did not fix
I think the line I was refering to is fine:
min_code_point - code_point > (u32::MAX - delta) / (processed + 1)
min_code_point
should be lager than code_point
due to the iterator filter c >= code_point
as such this can't underflow on min_code_point - code_point
u32::MAX - delta
cannot underflow either as delta
can't be larger than u32:MAX
process + 1
can't overflow as process < input_length
per the while condition
process + 1
is not 0 as process is unsigned, so no division by zero
Restructured changes and moved test to the idna creat where it belongs in my opinion.
debug_metadata/README.md
as it was always considered dirty and prevented me from rebasing otherwise.Rebase again as I accidentally hardcoded the string in the Bad Punycode test instead of using the value(s) from bad_punycode_tests.json
.
This should now be ready for review again.
Attention: 4 lines
in your changes are missing coverage. Please review.
Comparison is base (
e39c9a2
) 81.81% compared to head (336623e
) 81.84%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Fixed added test to not increase msrv beyond 1.56 (I think this change also increases readability of the test) and fixed unrelated clippy lint. Ready for review again.
Now with fixed formatting. Ready for review again, sorry for the noise.
I messed up my rebase, one moment.
Ok, now the rebase should be fixed.
used checked addition so this does not panic in debug builds
related to issue #870
not sure if #870 is completely resolved as there are other comments indicating a possible overflow condition that I did not understand and as such did not fix