summaryrefslogtreecommitdiff
path: root/src/metastore.c
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemoc@gmail.com>2016-02-22 00:24:07 +0100
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2016-02-22 00:24:07 +0100
commitfbc3ebea75cb92d4ce847aa877269f4217ab6dee (patch)
tree68279040863a85b1c8efdffb236003ebd703f6ba /src/metastore.c
parent0350d4719922432f24a9b564dc318e9ca9bd7840 (diff)
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.
Diffstat (limited to 'src/metastore.c')
-rw-r--r--src/metastore.c2
1 files changed, 1 insertions, 1 deletions
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;
}