From owner-svn-src-all@FreeBSD.ORG Mon Nov 17 19:00:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAF611065690; Mon, 17 Nov 2008 19:00:36 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D76388FC21; Mon, 17 Nov 2008 19:00:36 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAHJ0aiP090305; Mon, 17 Nov 2008 19:00:36 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAHJ0aFe090304; Mon, 17 Nov 2008 19:00:36 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <200811171900.mAHJ0aFe090304@svn.freebsd.org> From: Philip Paeps Date: Mon, 17 Nov 2008 19:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185026 - head/sys/crypto/via X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2008 19:00:37 -0000 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; }