-
Notifications
You must be signed in to change notification settings - Fork 6
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
LIB: fix invalid access to past last element #24
Conversation
- Accessing a vector element past the last (idx >= size) is UB and will trigger an assertion when built with assertions Signed-off-by: Hubert Figuière <[email protected]>
Yes, I agree this is UB and needs to be fixed. From a quick look at the source code, this is not the only place where Interestingly the address sanitizer and UB sanitizer don't really find this bug, but I can reproduce your "crash" by compiling with |
That one too. Maybe |
As reported in PR #24. Signed-off-by: Stefan Westerfeld <[email protected]>
As reported in PR #24. Signed-off-by: Stefan Westerfeld <[email protected]>
As reported in PR #24. Signed-off-by: Stefan Westerfeld <[email protected]>
* fix-out-of-bounds-ub: VST: avoid using &foo[0] on std::vector, can cause UB TOOLS: avoid using &foo[0] on std::vector, can cause UB SRC: smtool: avoid using &foo[0] on std::vector, can cause UB TESTS: avoid using &foo[0] on std::vector, can cause UB JACK: avoid using &foo[0] on std::vector, can cause UB INSPECTOR: avoid using &foo[0] on std::vector, can cause UB LIB: avoid using &foo[0] on std::vector, can cause UB LIB: add override/final for GenericIn / GenericOut classes VST: use MMapIn::open_vector to fix UB access past last vector element As reported in PR #24. TOOLS: use MMapIn::open_vector to fix UB access past last vector element As reported in PR #24. LIB: use MMapIn::open_vector to fix UB access past last vector element As reported in PR #24. LIB: MMapIn: support open_vector function to read data from vector Signed-off-by: Stefan Westerfeld <[email protected]>
I ended up with adding a method |
BTW Thanks ! |
The plugin was aborting on load when built as a flatpak.
(default CXX flags have C++ assertions enabled)