COMMON: Do not crash on malformed punycode strings

This commit is contained in:
Eugene Sandulenko 2022-07-05 14:16:55 +02:00
parent acac0a5f27
commit c9d88ac756
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -253,6 +253,11 @@ U32String punycode_decode(const String &src1) {
size_t org_i = i;
for (size_t w = 1, k = BASE; true; k += BASE) {
if (si >= src.size()) {
warning("punycode_decode: incorrect digit");
return src1;
}
size_t digit = decode_digit(src[si++]);
if (digit == SMAX) {