Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2008 19:00:36 +0000 (UTC)
From:      Philip Paeps <philip@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185026 - head/sys/crypto/via
Message-ID:  <200811171900.mAHJ0aFe090304@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: philip
Date: Mon Nov 17 19:00:36 2008
New Revision: 185026
URL: http://svn.freebsd.org/changeset/base/185026

Log:
  Fix a potential NULL-pointer dereference in padlock(4).
  
  Spotted by:	Coverity (via pjd)
  MFC after:	1 week

Modified:
  head/sys/crypto/via/padlock.c

Modified: head/sys/crypto/via/padlock.c
==============================================================================
--- head/sys/crypto/via/padlock.c	Mon Nov 17 18:45:07 2008	(r185025)
+++ head/sys/crypto/via/padlock.c	Mon Nov 17 19:00:36 2008	(r185026)
@@ -297,7 +297,11 @@ padlock_process(device_t dev, struct cry
 
 	enccrd = maccrd = NULL;
 
-	if (crp == NULL || crp->crp_callback == NULL || crp->crp_desc == NULL) {
+	/* Sanity check. */
+	if (crp == NULL)
+		return (EINVAL);
+
+	if (crp->crp_callback == NULL || crp->crp_desc == NULL) {
 		error = EINVAL;
 		goto out;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811171900.mAHJ0aFe090304>