You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Daniel, thank you so much for sharing your code with the community.
While experimenting with the hat-trie, I hit an exception in ahtable_iter_key() - when the "i" iterator is NULL: const char* ahtable_iter_key(ahtable_iter_t* i, size_t* len).
I do not understand the code enough to suggest a proper fix, I just "patched" it as follows:
Add a null check upon the entry into ahtable_iter_key():
const char* ahtable_iter_key(ahtable_iter_t* i, size_t* len)
{
if (i == NULL) return NULL; //add this null check
Add a null check in hattrie_iter_prefix_satisfied():
if (i->level + size < i->prefixsize) {
// early exit, child key is too short to match prefix
return false;
}
else if (key == NULL) { //add this null check
return false;
} else {
return (memcmp(key, i->prefix + i->level, i->prefixsize - i->level) == 0);
}
This problem only occurs under specific conditions - if necessary, I can provide the input data to replicate the exception.
Kind regards, --Raj
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Hi Daniel, thank you so much for sharing your code with the community.
While experimenting with the hat-trie, I hit an exception in ahtable_iter_key() - when the "i" iterator is NULL:
const char* ahtable_iter_key(ahtable_iter_t* i, size_t* len)
.I do not understand the code enough to suggest a proper fix, I just "patched" it as follows:
This problem only occurs under specific conditions - if necessary, I can provide the input data to replicate the exception.
Kind regards, --Raj
The text was updated successfully, but these errors were encountered: