Coverity CID 1700533 - Handle fr_hash_table_delete return - #5924
Coverity CID 1700533 - Handle fr_hash_table_delete return#5924ethan-thompson wants to merge 1 commit into
Conversation
|
@claude review |
|
Claude finished @arr2036's task in 2m 48s —— View job Claude Code Review
Reviewed 1. Returning
|
009f63b to
423398b
Compare
423398b to
61690df
Compare
|
Addressing the Claude review:
|
0238416 to
2bb04ce
Compare
|
Could you rebase and push again, if nothing else it's useful to check cI :) |
…0533) Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
2bb04ce to
ad34395
Compare
Possible returns for fr_hash_table_delete and how we handle them (and reasoning):
-1means the comparator errored mid-search, sofilemay still be linked into the table. This really shouldn't happen, especially since it is just a strcmp, but if it does happen then this is fatal since there is no safe recovery available here to prevent a potential use-after-free.0the delete was fine. We don't need to do anything else.1the entry was not found, meaningfilewasn't in thefile_table. This shouldn't happen given the insert always precedes talloc_set_destructor(), and nothing is dangling, so we are safe to free. We log it (and panic in debug builds) even though nothing acts on the result, since we don't want to silently miss this case in a future code change.