Overpass-API icon indicating copy to clipboard operation
Overpass-API copied to clipboard

Timestamp constructor may trigger segmentation fault

Open mmd-osm opened this issue 3 years ago • 0 comments

One of the Timestamp constructors reads 8 bytes from void*, although a Timestamp has only 5 bytes. I've seen some issues in connection with attic data, where the timestamp was at the very end of an allocated memory block, and reading 8 bytes instead of the permitted 5 remaining bytes triggered a segmentation fault. g++ address sanitizer also complains about undefined behavior due to a heap-buffer-overflow. Proposed fix would be to read exactly 5 bytes instead of 8.

timestamp

A similar issue needs to be fixed in the Attic constructor as well:

timestamp2

mmd-osm avatar Jun 27 '21 16:06 mmd-osm