jsonsl icon indicating copy to clipboard operation
jsonsl copied to clipboard

memset for clearing jmptable is incorrect when sizeof(size_t) != sizeof(int)

Open ghost opened this issue 10 months ago • 0 comments

I don't have code that exercises this problem, but I noticed this issue during a close reading.

I'd expect the problem to allow references to uninitialized data as well as false matches when using json pointer APIs on 64-bit systems. This memset assumes sizeof(int) element length, when the actual table element type is size_t.

https://github.com/mnunberg/jsonsl/blob/684b60f9af68b8c397422e74d0c2dd206de16a2c/jsonsl.c#L1213

ghost avatar Feb 26 '25 19:02 ghost