Skip to content

Avoid a potential underflow when iterating over invalid inputs#3096

Open
dirkmueller wants to merge 1 commit into
catchorg:develfrom
dirkmueller:devel
Open

Avoid a potential underflow when iterating over invalid inputs#3096
dirkmueller wants to merge 1 commit into
catchorg:develfrom
dirkmueller:devel

Conversation

@dirkmueller
Copy link
Copy Markdown

The forward iteration logic already bounds-check for m_it != m_string->end(), do the same for the backward iteration. The issue with the assert is that the assert() might not be compiled in, and it is happening after the dereference, so it was too late.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.33%. Comparing base (300c5d3) to head (db3b6e5).
⚠️ Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3096      +/-   ##
==========================================
- Coverage   91.36%   91.33%   -0.03%     
==========================================
  Files         204      204              
  Lines        8903     8902       -1     
==========================================
- Hits         8134     8130       -4     
- Misses        769      772       +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@horenmar
Copy link
Copy Markdown
Member

horenmar commented May 8, 2026

Thanks, but the change should have tests.

The forward iteration logic already bounds-check for m_it != m_string->end(),
do the same for the backward iteration. The issue with the assert is
that the assert() might not be compiled in, and it is happening after
the dereference, so it was too late.
@dirkmueller
Copy link
Copy Markdown
Author

Thanks, but the change should have tests.

testcase added.

@dirkmueller
Copy link
Copy Markdown
Author

ok, the testcase is failing some check, no idea what to do now. any hints?

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.

2 participants