From owner-p4-projects@FreeBSD.ORG Sun Aug 29 01:10:55 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D73A716A4D0; Sun, 29 Aug 2004 01:10:54 +0000 (GMT) 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 9D36416A4CE for ; Sun, 29 Aug 2004 01:10:54 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 805D043D5A for ; Sun, 29 Aug 2004 01:10:54 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i7T1AsJx030129 for ; Sun, 29 Aug 2004 01:10:54 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i7T1AscI030126 for perforce@freebsd.org; Sun, 29 Aug 2004 01:10:54 GMT (envelope-from wsalamon@computer.org) Date: Sun, 29 Aug 2004 01:10:54 GMT Message-Id: <200408290110.i7T1AscI030126@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Subject: PERFORCE change 60626 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2004 01:10:55 -0000 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);