diff options
author | tedu <> | 2015-03-05 17:15:48 +0000 |
---|---|---|
committer | tedu <> | 2015-03-05 17:15:48 +0000 |
commit | 05edf44920153ec98d1cb027c6751945237abe23 (patch) | |
tree | 202ffc9d6abc74b129010022b98e587a7b8d6899 | |
parent | 0225742a22afb27365a2a35975ddf17ff0507673 (diff) | |
download | openbsd-05edf44920153ec98d1cb027c6751945237abe23.tar.gz openbsd-05edf44920153ec98d1cb027c6751945237abe23.tar.bz2 openbsd-05edf44920153ec98d1cb027c6751945237abe23.zip |
subtraction is not comparison. the difference of two longs is not good
to place in an int. from Christian Neukirchen
ok deraadt
-rw-r--r-- | src/usr.bin/openssl/certhash.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
121 | struct hashinfo *hib = *(struct hashinfo **)b; | 121 | struct hashinfo *hib = *(struct hashinfo **)b; |
122 | int rv; | 122 | int rv; |
123 | 123 | ||
124 | rv = hia->hash - hib->hash; | 124 | rv = hia->hash < hib->hash ? -1 : hia->hash > hib->hash; |
125 | if (rv != 0) | 125 | if (rv != 0) |
126 | return (rv); | 126 | return (rv); |
127 | rv = memcmp(hia->fingerprint, hib->fingerprint, | 127 | rv = memcmp(hia->fingerprint, hib->fingerprint, |