diff options
author | guenther <> | 2015-02-12 04:26:46 +0000 |
---|---|---|
committer | guenther <> | 2015-02-12 04:26:46 +0000 |
commit | a0629970a80f4f7ea0c67a1f981a5ba69ff9f238 (patch) | |
tree | 98875c7b109fab975797e07c97aa5d1736315fda /src | |
parent | 3e3f6ec66f3d0f27fbe7349f8131243574f2d5c9 (diff) | |
download | openbsd-a0629970a80f4f7ea0c67a1f981a5ba69ff9f238.tar.gz openbsd-a0629970a80f4f7ea0c67a1f981a5ba69ff9f238.tar.bz2 openbsd-a0629970a80f4f7ea0c67a1f981a5ba69ff9f238.zip |
qsort() compare functions MUST use memcmp() instead of bcmp() to have
the correct return value. Prefer memcmp() anyway for portability.
ok jsing@ tedu@
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.bin/openssl/certhash.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/certhash.c b/src/usr.bin/openssl/certhash.c index a7a42d7f59..7458add906 100644 --- a/src/usr.bin/openssl/certhash.c +++ b/src/usr.bin/openssl/certhash.c | |||
@@ -121,7 +121,8 @@ hashinfo_compare(const void *a, const void *b) | |||
121 | rv = hia->hash - hib->hash; | 121 | rv = hia->hash - hib->hash; |
122 | if (rv != 0) | 122 | if (rv != 0) |
123 | return (rv); | 123 | return (rv); |
124 | rv = bcmp(hia->fingerprint, hib->fingerprint, sizeof(hia->fingerprint)); | 124 | rv = memcmp(hia->fingerprint, hib->fingerprint, |
125 | sizeof(hia->fingerprint)); | ||
125 | if (rv != 0) | 126 | if (rv != 0) |
126 | return (rv); | 127 | return (rv); |
127 | return strcmp(hia->filename, hib->filename); | 128 | return strcmp(hia->filename, hib->filename); |
@@ -404,7 +405,8 @@ certhash_index(struct hashinfo *head, const char *name) | |||
404 | for (entry = head; entry != NULL; entry = entry->next) { | 405 | for (entry = head; entry != NULL; entry = entry->next) { |
405 | if (last != NULL) { | 406 | if (last != NULL) { |
406 | if (entry->hash == last->hash) { | 407 | if (entry->hash == last->hash) { |
407 | if (bcmp(entry->fingerprint, last->fingerprint, | 408 | if (memcmp(entry->fingerprint, |
409 | last->fingerprint, | ||
408 | sizeof(entry->fingerprint)) == 0) { | 410 | sizeof(entry->fingerprint)) == 0) { |
409 | fprintf(stderr, "WARNING: duplicate %s " | 411 | fprintf(stderr, "WARNING: duplicate %s " |
410 | "in %s (using %s), ignoring...\n", | 412 | "in %s (using %s), ignoring...\n", |