mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
bug 898221 - search backwards for the last punycode delimiter instead of forwards. r=hurley
This commit is contained in:
parent
db283de51f
commit
98e52ccb66
@ -215,7 +215,12 @@ enum punycode_status punycode_decode(
|
||||
/* points before the last delimiter, or 0 if there is none, then */
|
||||
/* copy the first b code points to the output. */
|
||||
|
||||
for (b = j = 0; j < input_length; ++j) if (delim(input[j])) b = j;
|
||||
for (b = 0, j = input_length - 1 ; j > 0; --j) {
|
||||
if (delim(input[j])) {
|
||||
b = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (b > max_out) return punycode_big_output;
|
||||
|
||||
for (j = 0; j < b; ++j) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user