Overpass-API
Overpass-API copied to clipboard
Timestamp constructor may trigger segmentation fault
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.
A similar issue needs to be fixed in the Attic constructor as well: