-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Risk of causing bugs due to inconsistency in interfaces of AlignedTableTightAlloc
#3994
Labels
Comments
Thank you submitting the issue! I've confirmed that calling clear with
|
pankajsingh88
added a commit
to pankajsingh88/faiss
that referenced
this issue
Oct 28, 2024
Summary: Avoid null pointer error by checking that `numel > 0`. It's equivalent of checking`ptr != null` but keeping numel check for consistency. Bug reported in: facebookresearch#3994 Differential Revision: D65073502
pankajsingh88
added a commit
to pankajsingh88/faiss
that referenced
this issue
Oct 28, 2024
…rch#3997) Summary: Avoid null pointer error by checking that `numel > 0`. It's equivalent of checking`ptr != null` but keeping numel check for consistency. Bug reported in: facebookresearch#3994 Reviewed By: mnorris11 Differential Revision: D65073502
facebook-github-bot
pushed a commit
that referenced
this issue
Oct 28, 2024
Summary: Pull Request resolved: #3997 Avoid null pointer error by checking that `numel > 0`. It's equivalent of checking`ptr != null` but keeping numel check for consistency. Bug reported in: #3994 Reviewed By: mnorris11 Differential Revision: D65073502 fbshipit-source-id: f9aa56cbcd28fc352d45ef5b8727fa857fbe5345
closing since the fix #3997 has landed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
faiss/utils/AlignedTable.h
, in the classAlignedTableTightAlloc
, we can see from the functionresize
that the pointer memberptr
may be set to null. The copy constructor has taken this into consideration and has performed a checkif (numel > 0)
before passingptr
tomemcpy
(which was added in 74ee67a). However, the functionclear
does not seem to have realized this.Maybe a check should also be performed in
clear
before callingmemset
?The text was updated successfully, but these errors were encountered: