From fbc3ebea75cb92d4ce847aa877269f4217ab6dee Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Mon, 22 Feb 2016 00:24:07 +0100 Subject: metastore.c: Be more strict about arguments in compare_print(). That way we can avoid possible (yet not feasible in current code) NULL pointer dereference. --- src/metastore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/metastore.c b/src/metastore.c index 579f892..e95a0d5 100644 --- a/src/metastore.c +++ b/src/metastore.c @@ -91,7 +91,7 @@ insert_entry_pdlist(struct metaentry **list, struct metaentry *entry) static void compare_print(struct metaentry *real, struct metaentry *stored, int cmp) { - if (!real && !stored) { + if (!real && (!stored || (cmp == DIFF_NONE || cmp & DIFF_ADDED))) { msg(MSG_ERROR, "%s called with incorrect arguments\n", __func__); return; } -- cgit v1.2.1