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

Size Check to avoid segfault #6565

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

Conversation

areddy1213
Copy link

Hi Team,
I am from Cohesity while I was trying rocksdb6.4.6 APIs I found that if the size of the sorted_files is 0 it will lead to a SEG FAULT as in the for loop it's checking if i < sorted_files.size() -1 .
If sorted_files.size() ==0 then sorted_files.size()-1 is a positive number as it is of the type size_t which is unsigned. Hence to avoid this I have added a safer continue option to continue when a sorted_files.size() is less than or equal to 1.

@facebook-github-bot
Copy link
Contributor

Hi @areddy1213!

Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

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

2 participants