From 85acd57c8a288ce92f42bcf62737eebe385bce90 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 28 Apr 2017 10:21:45 -0400 Subject: [PATCH] base: fix error_cmp Fix the numeric error value comparison performed by error_cmp(). Identified by AppChecker and previously fixed by Darwin. Change-Id: I0a72fd381bef0b34b7e7d155bfff03ab4196d38e --- lib/base/error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/base/error.c b/lib/base/error.c index a1bbfa8a1..8ae65de49 100644 --- a/lib/base/error.c +++ b/lib/base/error.c @@ -53,8 +53,8 @@ static int error_cmp(void *a, void *b) { struct heim_error *ap = a, *bp = b; - if (ap->error_code == ap->error_code) - return ap->error_code - ap->error_code; + if (ap->error_code == bp->error_code) + return 0; return heim_cmp(ap->msg, bp->msg); }