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

Add safety note to the some unsafe functions. #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add safety note to the some unsafe functions. #167

wants to merge 1 commit into from

Conversation

hbina
Copy link
Contributor

@hbina hbina commented Oct 21, 2020

Mostly just moving comment and adding some additional informations.

Signed-off-by: Hanif Bin Ariffin hanif.ariffin.4326@gmail.com

Mostly just moving comment and adding some additional informations.

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Comment on lines +526 to +528
/// number of “valid” elements in the vector. This new value
/// might not correspond to the actual number of elements in the
/// vector which many functions rely to be true. Use with care.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to just merge this since the way it's written here makes it sound as though it's ok to set the length to a value that does not correspond to the number of initialized elements in the vector. That's not really true: length must be set to a correct value, but the caller is responsible for checking the value (thus the method is unsafe).

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