CVE-2019-5953: Buffer overflow in wget IRI character conversion
1b421e00-0cba-4d1e-a426-e2b9f1452931
CVE-2019-5953 is a buffer overflow vulnerability in wget v1.20.1 affecting the internationalized resource identifier (IRI) support. When processing URLs with non-ASCII characters that require character set conversion, wget's do_conversion() function in src/iri.c incorrectly manages the output buffer size during reallocation, allowing iconv() to write beyond allocated memory.",
len and outlen are set to done + inlen * 2. Since done represents bytes already written, this causes outlen (remaining space) to be calculated as total_new_size instead of remaining_space = new_size - done. Verified by examining git commit 692d5c52 which contains the actual fix, confirming the buffer overflow and its correction.",
len = done + inlen * 2, (2) Reallocate to len + 1 bytes, (3) Set write pointer correctly with *out = s + done - outlen, (4) Update remaining space as outlen += inlen * 2 rather than resetting to total. This ensures iconv() has correct information about available space.",