summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d93606)
raw | patch | inline | side by side (parent: 0d93606)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 28 Jul 2014 07:15:19 +0000 (09:15 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 28 Jul 2014 07:15:19 +0000 (09:15 +0200) |
Added a unit-test exposing the segfault we would have seen previously.
src/core/store_lookup.c | patch | blob | history | |
t/unit/core/store_lookup_test.c | patch | blob | history |
index 0bb157c76e7a49162e3832f5b9ae0e013372485a..8aa8ab085e4dd1fc40eb2586e95ea62cb506ba2c 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
else
return NULL;
+ if (! value)
+ return NULL;
+
if (value->type != SDB_TYPE_STRING) {
if (type == SDB_ATTRIBUTE)
return parse_attr_cmp(attr, op, value);
index 351ae18da7dfd899c918c897da267503597d644b..43bb1e53d7746bcc4689895be686f5eeacd04aff 100644 (file)
{ "host", NULL, "<=", &hostname, -1 },
{ "host", NULL, ">=", &hostname, -1 },
{ "host", NULL, ">", &hostname, -1 },
+ { "host", NULL, "=", NULL, -1 },
{ "service", NULL, "=", &srvname, MATCHER_NAME },
{ "service", NULL, "!=", &srvname, MATCHER_NOT },
{ "service", NULL, "=~", &srvname, MATCHER_NAME },
{ "service", NULL, "<=", &srvname, -1 },
{ "service", NULL, ">=", &srvname, -1 },
{ "service", NULL, ">", &srvname, -1 },
+ { "service", NULL, "=", NULL, -1 },
{ "attribute", NULL, "=", &attrname, MATCHER_NAME },
{ "attribute", NULL, "!=", &attrname, MATCHER_NOT },
{ "attribute", NULL, "=~", &attrname, MATCHER_NAME },
{ "attribute", NULL, "<=", &attrname, -1 },
{ "attribute", NULL, ">=", &attrname, -1 },
{ "attribute", NULL, ">", &attrname, -1 },
+ { "attribute", NULL, "=", NULL, -1 },
{ "attribute", "attr", "=", &attrname, MATCHER_ATTR },
{ "attribute", "attr", "!=", &attrname, MATCHER_NOT },
{ "attribute", "attr", "=~", &attrname, MATCHER_ATTR },
{ "attribute", "attr", "!~", &attrname, MATCHER_NOT },
{ "attribute", "attr", "&^", &attrname, -1 },
+ { "attribute", "attr", "<", NULL, -1 },
{ "attribute", "attr", "<", &attrname, MATCHER_LT },
{ "attribute", "attr", "<=", &attrname, MATCHER_LE },
/* { "attribute", "attr", "=", &attrname, MATCHER_EQ }, */