/** @internal Slot data getter */
static inline void *lru_slot_get(struct lru_hash_base *lru, const char *key, uint32_t len, size_t offset)
{
+ if (!lru || !key || len == 0) {
+ return NULL;
+ }
uint32_t id = hash(key, len) % lru->size;
struct lru_slot *slot = (struct lru_slot *)(lru->slots + (id * lru->stride));
if (lru_slot_match(slot, key, len)) {
/** @internal Slot data setter */
static inline void *lru_slot_set(struct lru_hash_base *lru, const char *key, uint32_t len, size_t offset)
{
+ if (!lru || !key || len == 0) {
+ return NULL;
+ }
uint32_t id = hash(key, len) % lru->size;
struct lru_slot *slot = (struct lru_slot *)(lru->slots + (id * lru->stride));
if (!lru_slot_match(slot, key, len)) {
}
/* Start at QNAME parent. */
- name = knot_wire_next_label(name, NULL);
- while (txn && name) {
+ if (name[0] != '\0') {
+ name = knot_wire_next_label(name, NULL);
+ }
+ while (txn) {
if (fetch_ns(ctx, cut, name, txn, timestamp) == 0) {
update_cut_name(cut, name);
return kr_ok();