Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2010 08:33:12 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 179007 for review
Message-ID:  <201005310833.o4V8XCGU032758@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@179007?ac=10

Change 179007 by rwatson@rwatson_cinnamon on 2010/05/31 08:32:41

	Don't dereference a NULL pointer if memory allocation fails in
	au_to_socket_sx().  Affects only the userspace BSM code, as kernel
	BSM allocates tokens using M_WAITOK.
	
	Reported by:	clang static analyzer

Affected files ...

.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#94 edit

Differences ...

==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#94 (text+ko) ====

@@ -30,7 +30,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#93 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#94 $
  */
 
 #include <sys/types.h>
@@ -968,6 +968,8 @@
 		errno = EINVAL;
 		return (NULL);
 	}
+	if (t == NULL)
+		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_SOCKET_EX);
 	ADD_U_INT16(dptr, au_domain_to_bsm(so_domain));



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