mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 11:51:52 +00:00
COMMON: Do not crash on malformed punycode strings
This commit is contained in:
parent
acac0a5f27
commit
c9d88ac756
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user