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

Out of bounds vector access #61

Closed
fnxweb opened this issue Nov 28, 2019 · 1 comment
Closed

Out of bounds vector access #61

fnxweb opened this issue Nov 28, 2019 · 1 comment
Labels

Comments

@fnxweb
Copy link
Contributor

fnxweb commented Nov 28, 2019

I accidentally caught a Visual Studio debug assertion (not exactly sure what I typed) but it highlighted a possible out of bounds vector access in replxx_impl.cxx (line 1871 at time of writing):

} else if ( ( dp._direction > 0 ) ? ( historySearchIndex < _history.size() ) : ( historySearchIndex > 0 ) ) {
  historySearchIndex += dp._direction;
  activeHistoryLine.assign( _history[historySearchIndex] );

_direction was incremented to have the value of the actual size of the vector, thus going out; I think the check in the if should be: ( historySearchIndex < _history.size() - 1 )

@AmokHuginnsson
Copy link
Owner

Thank you for this report.

I have applied suggested fix in 8915f96.

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

No branches or pull requests

2 participants