7369eff4ed
If a file with an input line larger than INT32_MAX (i.e. 2 GB) contains an UTF8 character after that limit, escapesrc crashes on 64 bit systems or does not remove incomplete files on 32 bit systems. The issue is that an unchecked cast from size_t to int32_t can turn negative, which results in negative offsets during array access. This will eventually lead to an out of boundary read, which most likely crashes the tool. This patch sets a fixed limit on 1 GB to make sure that no side effects occur if the line is exactly INT32_MAX or a few bytes less. It should still be way more than anyone would really need. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> |
||
---|---|---|
.. | ||
cptbl.h | ||
escapesrc.cpp | ||
expect-simple.cpp | ||
Makefile.in | ||
tblgen.cpp | ||
test-nochange.cpp | ||
test-simple.cpp |