From 05edf44920153ec98d1cb027c6751945237abe23 Mon Sep 17 00:00:00 2001 From: tedu <> Date: Thu, 5 Mar 2015 17:15:48 +0000 Subject: subtraction is not comparison. the difference of two longs is not good to place in an int. from Christian Neukirchen ok deraadt --- src/usr.bin/openssl/certhash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/usr.bin/openssl/certhash.c b/src/usr.bin/openssl/certhash.c index dd0e12f68b..d0d1d8c771 100644 --- a/src/usr.bin/openssl/certhash.c +++ b/src/usr.bin/openssl/certhash.c @@ -121,7 +121,7 @@ hashinfo_compare(const void *a, const void *b) struct hashinfo *hib = *(struct hashinfo **)b; int rv; - rv = hia->hash - hib->hash; + rv = hia->hash < hib->hash ? -1 : hia->hash > hib->hash; if (rv != 0) return (rv); rv = memcmp(hia->fingerprint, hib->fingerprint, -- cgit v1.2.3-55-g6feb