Code

data: Let sdb_data_expr_eval() check it's arguments.
authorSebastian Harl <sh@tokkee.org>
Sat, 2 Aug 2014 10:35:12 +0000 (12:35 +0200)
committerSebastian Harl <sh@tokkee.org>
Sat, 2 Aug 2014 10:53:32 +0000 (12:53 +0200)
src/core/data.c

index fc646f0b5456c5842900223e759698866699b7f3..0f10538fe6313f798eef54dd9c1ce081974f4108 100644 (file)
@@ -208,6 +208,8 @@ int
 sdb_data_expr_eval(int op, const sdb_data_t *d1, const sdb_data_t *d2,
                sdb_data_t *res)
 {
+       if ((! d1) || (! d2) || (! res))
+               return -1;
        switch (op) {
                case SDB_DATA_CONCAT:
                        return data_concat(d1, d2, res);