]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/asymmetric_keys/pkcs7_parser.c
pkcs7: Prevent NULL pointer dereference, since sinfo is not always set.
[mirror_ubuntu-bionic-kernel.git] / crypto / asymmetric_keys / pkcs7_parser.c
index af4cd864911752478ba5f3c2732273f9624d434f..d140d8bb2c96140c408b1e3450f288e562372743 100644 (file)
@@ -88,6 +88,9 @@ static int pkcs7_check_authattrs(struct pkcs7_message *msg)
        bool want = false;
 
        sinfo = msg->signed_infos;
+       if (!sinfo)
+               goto inconsistent;
+
        if (sinfo->authattrs) {
                want = true;
                msg->have_authattrs = true;