Date: Sat, 21 Jan 2006 12:09:08 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90059 for review Message-ID: <200601211209.k0LC98AQ069745@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601211209.k0LC98AQ069745>