From 34ddaa716174e29c42f005e3546dbbeeb60c7057 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 26 Mar 2010 07:09:47 +0200 Subject: [PATCH] Handle NULL and the same literal problem pointer in rpmProblemCompare() - if the pointers to compare are the same, the problem is the same (even if NULL for our purposes) - if they're not the same and either is NULL then they're not the same --- lib/rpmprob.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rpmprob.c b/lib/rpmprob.c index 1a5eef2..511a5b1 100644 --- a/lib/rpmprob.c +++ b/lib/rpmprob.c @@ -200,6 +200,10 @@ static int cmpStr(const char *s1, const char *s2) int rpmProblemCompare(rpmProblem ap, rpmProblem bp) { + if (ap == bp) + return 0; + if (ap == NULL || bp == NULL) + return 1; if (ap->type != bp->type) return 1; if (ap->key != bp->key) -- 2.7.4