]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
pubkey: Validate input parameters in pubkey_import_ecc_raw
authorJakub Jelen <jjelen@redhat.com>
Fri, 6 Mar 2020 12:41:25 +0000 (13:41 +0100)
committerJakub Jelen <jjelen@redhat.com>
Wed, 18 Mar 2020 08:31:42 +0000 (09:31 +0100)
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
lib/pubkey.c

index 0e0d0ada478bda31de9bbfb9e5de87a0c08d41b5..50214b2991db2349b859b3a4c5c09618a4d2711c 100644 (file)
@@ -1447,7 +1447,7 @@ gnutls_pubkey_import_ecc_raw(gnutls_pubkey_t key,
 {
        int ret;
 
-       if (key == NULL) {
+       if (key == NULL || x == NULL) {
                gnutls_assert();
                return GNUTLS_E_INVALID_REQUEST;
        }
@@ -1485,6 +1485,11 @@ gnutls_pubkey_import_ecc_raw(gnutls_pubkey_t key,
        }
 
        /* ECDSA */
+       if (y == NULL) {
+               gnutls_assert();
+               return GNUTLS_E_INVALID_REQUEST;
+       }
+
        key->params.curve = curve;
 
        if (_gnutls_mpi_init_scan_nz