From patchwork Wed Nov 25 19:04:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ameen Ali X-Patchwork-Id: 7702481 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D750FBF90C for ; Wed, 25 Nov 2015 19:04:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20FF6207EA for ; Wed, 25 Nov 2015 19:04:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 528F8207E1 for ; Wed, 25 Nov 2015 19:04:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbbKYTEX (ORCPT ); Wed, 25 Nov 2015 14:04:23 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35755 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbbKYTEW (ORCPT ); Wed, 25 Nov 2015 14:04:22 -0500 Received: by wmeo63 with SMTP id o63so13878401wme.2; Wed, 25 Nov 2015 11:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=UmK0qggjKSsDDhbL3iXBH2AYgwjtY3Zrvx0TvocSEJ0=; b=B6fkaP5ss/JHCl9OBmhr5ikVYNt+gQs9Nd8TQKVuR0U5GXcRtwpECL/eEMhb8dqkfC +2uhoJ9E5v2aaDpVLUQU/2IICvnHb2KEH9vG4JctoQNOwkkHn7nC/RNDqalIyfrGV5AW ptPFbvBe/9Ante8M5czrl9Ng9qnfuu+pXMFp9o0Yd59n3vlO+5+yIAqPntxUFsM98R52 r7SWswAZntSNqyKS94xJPWi3qeYM1YauNW01/sIMIKGoyY3HDIHYghuNKkJAFAh7SRQA wh+N2bGqL8z5EsrwvsAihz/irStOc0vYYg5atgwRO1l2dxI0thWAcPuJuFDZBs3i90kP 6w6A== X-Received: by 10.28.86.196 with SMTP id k187mr6145900wmb.61.1448478260895; Wed, 25 Nov 2015 11:04:20 -0800 (PST) Received: from localhost.localdomain (IGLD-84-228-101-120.inter.net.il. [84.228.101.120]) by smtp.gmail.com with ESMTPSA id kw2sm21017948wjb.42.2015.11.25.11.04.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 11:04:20 -0800 (PST) From: Ameen X-Google-Original-From: Ameen To: herbert@gondor.apana.org.au, davem@davemloft.net, dhowells@redhat.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Ameen Subject: [PATCH 2/2] updating for keypayload null check. Date: Wed, 25 Nov 2015 21:04:15 +0200 Message-Id: <1448478255-5443-1-git-send-email-AmeenAli023@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP adding NULL check to make it fail safe. Signed-Off-By : Ameen Ali --- crypto/asymmetric_keys/x509_public_key.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c index 2a44b37..76610cc 100644 --- a/crypto/asymmetric_keys/x509_public_key.c +++ b/crypto/asymmetric_keys/x509_public_key.c @@ -286,6 +286,10 @@ static int x509_key_preparse(struct key_preparsed_payload *prep) char *desc = NULL, *p; int ret; + if(prep == NULL){ + pr_debug("NULL payload"); + return PTR_ERR(prep); + } cert = x509_cert_parse(prep->data, prep->datalen); if (IS_ERR(cert)) return PTR_ERR(cert);