summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-09-26 08:12:52 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-09-26 08:15:49 +0200
commitda4c7a393d273076af4f650f6cb1fd6329078824 (patch)
tree7cfb0ad9421559ce6fff90c71a01aee5dee8e92f
parentae9acc56be22f25daab9081fb5ab5d3247c4175f (diff)
downloadgnutls-da4c7a393d273076af4f650f6cb1fd6329078824.tar.gz
gnutls_oid_to_ecc_curve: fix null pointer dereference
This addresses issue where an unknown curve would cause a null pointer dereference. This was introduced with the addition of X25519. Reported by Theofilos Petsios.
-rw-r--r--lib/algorithms/ecc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/algorithms/ecc.c b/lib/algorithms/ecc.c
index ac1c3e2187..5274a815cb 100644
--- a/lib/algorithms/ecc.c
+++ b/lib/algorithms/ecc.c
@@ -159,7 +159,7 @@ gnutls_ecc_curve_t gnutls_oid_to_ecc_curve(const char *oid)
gnutls_ecc_curve_t ret = GNUTLS_ECC_CURVE_INVALID;
GNUTLS_ECC_CURVE_LOOP(
- if (strcasecmp(p->oid, oid) == 0 && _gnutls_pk_curve_exists(p->id)) {
+ if (p->oid && strcasecmp(p->oid, oid) == 0 && _gnutls_pk_curve_exists(p->id)) {
ret = p->id;
break;
}