PERFORCE change 19810 for review

Robert Watson rwatson at freebsd.org
Mon Oct 21 17:52:08 GMT 2002


http://perforce.freebsd.org/chv.cgi?CH=19810

Change 19810 by rwatson at rwatson_paprika on 2002/10/21 10:51:22

	Use != NULL rather than treating a pointer as a boolean.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#143 edit
.. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#124 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#143 (text+ko) ====

@@ -399,12 +399,13 @@
 
 	mac_biba->mb_rangelow.mbe_type = typelow;
 	mac_biba->mb_rangelow.mbe_grade = gradelow;
-	if (compartmentslow)
-		memcpy(mac_biba->mb_rangelow.mbe_compartments, compartmentslow,
+	if (compartmentslow != NULL)
+		memcpy(mac_biba->mb_rangelow.mbe_compartments,
+		    compartmentslow,
 		    sizeof(mac_biba->mb_rangelow.mbe_compartments));
 	mac_biba->mb_rangehigh.mbe_type = typehigh;
 	mac_biba->mb_rangehigh.mbe_grade = gradehigh;
-	if (compartmentshigh)
+	if (compartmentshigh != NULL)
 		memcpy(mac_biba->mb_rangehigh.mbe_compartments,
 		    compartmentshigh,
 		    sizeof(mac_biba->mb_rangehigh.mbe_compartments));
@@ -418,7 +419,7 @@
 
 	mac_biba->mb_single.mbe_type = type;
 	mac_biba->mb_single.mbe_grade = grade;
-	if (compartments)
+	if (compartments != NULL)
 		memcpy(mac_biba->mb_single.mbe_compartments, compartments,
 		    sizeof(mac_biba->mb_single.mbe_compartments));
 	mac_biba->mb_flags |= MAC_BIBA_FLAG_SINGLE;

==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#124 (text+ko) ====

@@ -388,13 +388,15 @@
 
 	mac_mls->mm_rangelow.mme_type = typelow;
 	mac_mls->mm_rangelow.mme_level = levellow;
-	if (compartmentslow)
-		memcpy(mac_mls->mm_rangelow.mme_compartments, compartmentslow,
+	if (compartmentslow != NULL)
+		memcpy(mac_mls->mm_rangelow.mme_compartments,
+		    compartmentslow,
 		    sizeof(mac_mls->mm_rangelow.mme_compartments));
 	mac_mls->mm_rangehigh.mme_type = typehigh;
 	mac_mls->mm_rangehigh.mme_level = levelhigh;
-	if (compartmentshigh)
-		memcpy(mac_mls->mm_rangehigh.mme_compartments, compartmentshigh,
+	if (compartmentshigh != NULL)
+		memcpy(mac_mls->mm_rangehigh.mme_compartments,
+		    compartmentshigh,
 		    sizeof(mac_mls->mm_rangehigh.mme_compartments));
 	mac_mls->mm_flags |= MAC_MLS_FLAG_RANGE;
 }
@@ -406,7 +408,7 @@
 
 	mac_mls->mm_single.mme_type = type;
 	mac_mls->mm_single.mme_level = level;
-	if (compartments)
+	if (compartments != NULL)
 		memcpy(mac_mls->mm_single.mme_compartments, compartments,
 		    sizeof(mac_mls->mm_single.mme_compartments));
 	mac_mls->mm_flags |= MAC_MLS_FLAG_SINGLE;
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list