Date: Sat, 21 Jan 2006 13:54:44 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90077 for review Message-ID: <200601211354.k0LDsi85082382@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90077 Change 90077 by rwatson@rwatson_sesame on 2006/01/21 13:53:51 More avoidance of hand-calculated token sizes. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#27 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#27 (text+ko) ==== @@ -151,8 +151,8 @@ u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2*sizeof(u_int16_t) + - 3*sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int16_t) + + 3 * sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -296,7 +296,8 @@ u_char *dptr = NULL; int i; - GET_TOKEN_AREA(t, dptr, n * 4 + 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + n * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -318,7 +319,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 5); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -340,7 +341,7 @@ u_char *dptr = NULL; u_int32_t type = AF_INET6; - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 5 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -389,7 +390,7 @@ u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 6); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -450,7 +451,6 @@ return (t); } - /* * token ID 1 byte * port IP address 2 bytes
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601211354.k0LDsi85082382>