diff options
| author | Przemyslaw Pawelczyk <przemoc@gmail.com> | 2016-02-22 00:24:07 +0100 |
|---|---|---|
| committer | Przemyslaw Pawelczyk <przemoc@gmail.com> | 2016-02-22 00:24:07 +0100 |
| commit | fbc3ebea75cb92d4ce847aa877269f4217ab6dee (patch) | |
| tree | 68279040863a85b1c8efdffb236003ebd703f6ba | |
| parent | 0350d4719922432f24a9b564dc318e9ca9bd7840 (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.
| -rw-r--r-- | src/metastore.c | 2 |
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; } |
