Bugs in iconvenc package
Original Reporter info from Mantis: Felis-Sapiens
-
Reporter name:
Original Reporter info from Mantis: Felis-Sapiens
- Reporter name:
Description:
packages/iconvenc/src/iconvert.inc
-
In case of error, iconv_open returns (iconv_t) -1. But the result is checked as
if not assigned(H) then
. -
iconv(H, nil, nil, @Dst, @Outlen)
leads to the null pointer dereference on Android 10 https://www.atozed.com/forums/thread-2269.html
https://android.googlesource.com/platform/bionic/+/master/libc/bionic/iconv.cpp#131
To be more robust, the code should be like:
InLen := 0;
iconv(H, nil, @InLen, @Dst, @Outlen);
Mantis conversion info:
- Mantis ID: 38510
- Fixed in revision: 49167 (#b2afecda)