[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Possible assert with new string semantics
- From: sainan@...
- Date: Fri, 08 Sep 2023 17:20:38 +0200
The latest commit 9b4f39ab14fb2e55345c3d23537d129dac23b091 introduces
undefined behaviour in internshrstr when LUAI_ASSERT is defined. The
problem lies in this line of code:
memcpy(getshrstr(ts), str, l * sizeof(char));
Because shrlen is not initialised, it is possible that its value is
0xFF, tripping the assert. This can be fixed by initialising this field
in createstrobj or moving the line that initialises it above the memcpy.