handle-tree: fix potential integer overflow in _handle_tree_compare
This commit is contained in:
parent
c1e99cb100
commit
e36129b91b
@ -6,7 +6,12 @@
|
||||
|
||||
static inline int _handle_tree_compare(handle_tree_entry_t* a,
|
||||
handle_tree_entry_t* b) {
|
||||
return a->key - b->key;
|
||||
if (a->key < b->key)
|
||||
return -1;
|
||||
else if (a->key > b->key)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
RB_GENERATE_STATIC(handle_tree,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user