PERFORCE change 179007 for review

Robert Watson rwatson at FreeBSD.org
Mon May 31 08:33:13 UTC 2010


http://p4web.freebsd.org/@@179007?ac=10

Change 179007 by rwatson at 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));


More information about the p4-projects mailing list