diff options
author | Simon Josefsson <simon@josefsson.org> | 2006-08-11 22:40:36 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2006-08-11 22:40:36 +0000 |
commit | 34d87a7c3f12794a3ec2305cd2fdbae152bf2a76 (patch) | |
tree | 44e17270b75777efd87bd5cfba4de7c96fff5a10 | |
parent | 5f848a10a791d73200a5b8801348a57e92ad6f28 (diff) | |
download | gnutls-34d87a7c3f12794a3ec2305cd2fdbae152bf2a76.tar.gz |
(_gnutls_x509_oid2mac_algorithm): Don't crash trying to strcmp the
NULL OID value in the hash_algorithms array, which happens when the
input OID doesn't match our OIDs for SHA1, MD5, MD2 or RIPEMD160.
Reported by satyakumar <satyam_kkd@hyd.hellosoft.com>.
-rw-r--r-- | lib/gnutls_algorithms.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c index 9dbff2e509..9be8de7ddf 100644 --- a/lib/gnutls_algorithms.c +++ b/lib/gnutls_algorithms.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation + * Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation * * Author: Nikos Mavroyanopoulos * @@ -563,7 +563,7 @@ _gnutls_x509_oid2mac_algorithm (const char *oid) { gnutls_mac_algorithm_t ret = 0; - GNUTLS_HASH_LOOP (if (strcmp (oid, p->oid) == 0) + GNUTLS_HASH_LOOP (if (p->oid && strcmp (oid, p->oid) == 0) { ret = p->id; break;} ); |