From owner-p4-projects@FreeBSD.ORG Sat Jan 21 12:09:10 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EDEFF16A422; Sat, 21 Jan 2006 12:09:09 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C99716A422 for ; Sat, 21 Jan 2006 12:09:09 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7E2E43D55 for ; Sat, 21 Jan 2006 12:09:08 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LC98Nt069748 for ; Sat, 21 Jan 2006 12:09:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LC98AQ069745 for perforce@freebsd.org; Sat, 21 Jan 2006 12:09:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 12:09:08 GMT Message-Id: <200601211209.k0LC98AQ069745@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90059 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 12:09:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=90059 Change 90059 by rwatson@rwatson_sesame on 2006/01/21 12:08:41 Parenthesize macro arguments. Don't check unsigned variable for negative values. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#23 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#23 (text+ko) ==== @@ -59,13 +59,13 @@ #define GET_TOKEN_AREA(t, dptr, length) do { \ t = malloc (sizeof(token_t)); \ if (t != NULL) { \ - t->len = length; \ - t->t_data = malloc (length * sizeof(u_char)); \ + t->len = (length); \ + t->t_data = malloc ((length) * sizeof(u_char)); \ if ((dptr = t->t_data) == NULL) { \ free(t); \ t = NULL; \ } else \ - memset(dptr, 0, length); \ + memset(dptr, 0, (length)); \ } \ } while (0) @@ -527,7 +527,7 @@ token_t *t; u_char *dptr = NULL; - if ((data == NULL) || (bytes <= 0)) { + if (data == NULL) { errno = EINVAL; return (NULL); }