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

Update array.hpp #3769

Merged
merged 4 commits into from
Jan 1, 2020
Merged

Update array.hpp #3769

merged 4 commits into from
Jan 1, 2020

Conversation

xqcool
Copy link
Contributor

@xqcool xqcool commented Dec 31, 2019

Problem:Calling back on an empty container causes undefined behavior.
Solution:Check with the function empty()

Problem:Calling back on an empty container causes undefined behavior.
Solution:Check with the function empty()
@bluca
Copy link
Member

bluca commented Dec 31, 2019

Thanks for the PR - please add a commit with a relicense statement https://github.com/zeromq/libzmq/blob/master/RELICENSE/README.md

Adds relicensing grant
@xqcool
Copy link
Contributor Author

xqcool commented Jan 1, 2020

Thanks for the PR - please add a commit with a relicense statement https://github.com/zeromq/libzmq/blob/master/RELICENSE/README.md

OK.

@bluca bluca merged commit 382c6d7 into zeromq:master Jan 1, 2020
@sigiesec
Copy link
Member

sigiesec commented Jan 6, 2020

You are right that calling back on an empty container has undefined behaviour, but this is not a legal use of array::erase anyway. Rather than changing the condition, the if should be removed entirely, or changed into zmq_assert (!_items.empty()); or rather zmq_assert (items.size() > index_);

@xqcool
Copy link
Contributor Author

xqcool commented Jan 7, 2020 via email

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.

None yet

3 participants