Date: Sun, 29 Aug 2004 01:10:54 GMT From: Wayne Salamon <wsalamon@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 60626 for review Message-ID: <200408290110.i7T1AscI030126@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=60626 Change 60626 by wsalamon@wsalamon_epi on 2004/08/29 01:10:45 Remove superfluous check of string termination character after using strlen(). Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_token.c#3 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/kern_bsm_token.c#5 edit Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_token.c#3 (text+ko) ==== @@ -74,12 +74,7 @@ return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, 9 + textlen); if(t == NULL) { return NULL; @@ -107,12 +102,7 @@ return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, 13 + textlen); if(t == NULL) { return NULL; @@ -537,12 +527,7 @@ if(file == NULL) { return NULL; } - /* Make sure that text is null terminated */ filelen = strlen(file); - if(file[filelen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, filelen + 12); if(t == NULL) { return NULL; @@ -576,12 +561,7 @@ if(text == NULL) { return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, textlen + 4); if(t == NULL) { return NULL; @@ -610,12 +590,7 @@ if(text == NULL) { return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, textlen + 4); if(t == NULL) { return NULL; @@ -1085,10 +1060,6 @@ int nextlen; nextlen = strlen(nextarg); - if(nextarg[nextlen] != '\0') { - return NULL; - } - totlen += nextlen + 1; count++; nextarg = *(args + count); @@ -1135,10 +1106,6 @@ int nextlen; nextlen = strlen(nextenv); - if(nextenv[nextlen] != '\0') { - return NULL; - } - totlen += nextlen + 1; count++; nextenv = *(env + count); ==== //depot/projects/trustedbsd/audit3/sys/security/audit/kern_bsm_token.c#5 (text+ko) ==== @@ -57,12 +57,7 @@ return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, 9 + textlen); if(t == NULL) { return NULL; @@ -90,12 +85,7 @@ return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, 13 + textlen); if(t == NULL) { return NULL; @@ -508,12 +498,7 @@ if(file == NULL) { return NULL; } - /* Make sure that text is null terminated */ filelen = strlen(file); - if(file[filelen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, filelen + 12); if(t == NULL) { return NULL; @@ -548,12 +533,7 @@ if(text == NULL) { return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, textlen + 4); if(t == NULL) { return NULL; @@ -582,12 +562,7 @@ if(text == NULL) { return NULL; } - /* Make sure that text is null terminated */ textlen = strlen(text); - if(text[textlen] != '\0') { - return NULL; - } - GET_TOKEN_AREA(t, dptr, textlen + 4); if(t == NULL) { return NULL; @@ -1201,10 +1176,6 @@ int nextlen; nextlen = strlen(nextarg); - if(nextarg[nextlen] != '\0') { - return NULL; - } - totlen += nextlen + 1; count++; nextarg = *(args + count); @@ -1251,10 +1222,6 @@ int nextlen; nextlen = strlen(nextenv); - if(nextenv[nextlen] != '\0') { - return NULL; - } - totlen += nextlen + 1; count++; nextenv = *(env + count);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408290110.i7T1AscI030126>