-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Description
With a specific data set, the art_iter_prefix find a full_match and goes deeper of the key_len.
// Bail if the prefix does not match
if (n->partial_len) {
[...]
// if there is a full match, go deeper
depth = depth + n->partial_len;
}
[...]
child = find_child(n, key[depth]); //KABOOUM when key_len is less than the depth
Simply change? :
// If we've matched the prefix, iterate on this node
if (prefix_len && ((depth + prefix_len) == key_len)) {
return recursive_iter(n, cb, data);
// If mismatch or no match, search is terminated
} else if(prefix_len < n->partial_len) {
return 0;
}
Not 100% sure is the optimal solution.
Metadata
Metadata
Assignees
Labels
No labels