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

Fix out of bound iterator in tests #189

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sciprosk
Copy link

@sciprosk sciprosk commented May 2, 2024

Hi everyone,

I was trying to build Ruckig w/ tests in Debug and got out-of-bound iterator access errors from some of the tests in
inline void add_profile(ProfileIter& profile) in a couple of places that was captured by asserts in STL.

It looks like the issue is with reserving std::array<Profile, 3> being the size of 3, while the profile iterator can advance by three from valid_profiles.begin() and point to valid_profiles.end() when being dereferenced eventually.

I summarize these behavior in a couple of commits. It would be also nice to add an input validation into add_profile to fail early in Debug (should be stripped out in Release anyway).

Environment: Visual Studio Community 2022 Release - x86_amd64; MSVC 17.9.34728.123; Debug build.

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

Successfully merging this pull request may close these issues.

1 participant