commaai / msgq

MSGQ: A lock free single producer multi consumer message queue
175 stars 252 forks source link

visionbuf: fix incorrect length passed to munmap #618

Closed deanlee closed 1 month ago

deanlee commented 3 months ago

fixed a bug in VisionBuf::free() where an incorrect length parameter was passed to munmap(), potentially causing memory issues.

In the allocate() method, the length of the memory mapping (mmap_len) was calculated as this->len + sizeof(uint64_t). However, in the free() method, only this->len was used as the length parameter for munmap(), resulting in an incorrect length.