Skip to content
New issue

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

Off-by-one error in FIFO #15

Open
StratisSofianos opened this issue Oct 31, 2022 · 0 comments
Open

Off-by-one error in FIFO #15

StratisSofianos opened this issue Oct 31, 2022 · 0 comments

Comments

@StratisSofianos
Copy link

fifo[LEN_INDEX] = n+FIFO_START+1;

This can cause an overflow if the size of the buffer is [FIFO_OVERHEAD + FIFO_SIZE] as per the app_xfifo_example.

In order to prevent that, the above line should read
fifo[LEN_INDEX] = n+FIFO_START;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant