Skip to content

[BOX32][WRAPPER] Fix inverted condition in del_cond()#3517

Merged
ptitSeb merged 1 commit intoptitSeb:mainfrom
devarajabc:0215_2
Feb 16, 2026
Merged

[BOX32][WRAPPER] Fix inverted condition in del_cond()#3517
ptitSeb merged 1 commit intoptitSeb:mainfrom
devarajabc:0215_2

Conversation

@devarajabc
Copy link
Contributor

@devarajabc devarajabc commented Feb 16, 2026

del_cond() had an inverted kh_end check introduced in bebae71.
k==kh_end(mapcond) means key "not found".
so it was never freed from the map, leaking memory on every call.
This causes use-after-free when cond is not in map and fails to delete
when it is in the map.

Fix: change == to != to match the correct khash idiom used elsewhere.

del_cond() had an inverted kh_end check introduced in bebae71.
k==kh_end(mapcond) means key NOT found, but the code proceeded to
call box_free and kh_del on the invalid iterator.

Fix: change == to != to match the correct khash idiom used elsewhere.
@ptitSeb ptitSeb merged commit f35c00e into ptitSeb:main Feb 16, 2026
27 checks passed
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