We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
While reviewing the ringbuffer code in rtapi/ring.h, I noticed a buffer overflow bug.
rtapi/ring.h
In stream_write:
stream_write
if (n2) { memcpy(&(ring->buf[t->tail + n1]), src + n1, n2); rtapi_smp_wmb(); rtapi_store_u32(&t->tail, (t->tail + n1 + n2) & h->size_mask); }
The memcpy should be:
memcpy(ring->buf, src + n1, n2);
Also the memory barrier is useless (the atomic store will issue one anyway), but that's another story.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
While reviewing the ringbuffer code in
rtapi/ring.h
, I noticed a buffer overflow bug.In
stream_write
:The memcpy should be:
Also the memory barrier is useless (the atomic store will issue one anyway), but that's another story.
The text was updated successfully, but these errors were encountered: