PERFORCE change 75313 for review

Robert Watson rwatson at FreeBSD.org
Sat Apr 16 11:02:27 GMT 2005


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

Change 75313 by rwatson at rwatson_paprika on 2005/04/16 11:01:50

	Only allocate storage for a new rule if we're not deleting an existing
	rule.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/security/mac_bsdextended/mac_bsdextended.c#89 edit

Differences ...

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

@@ -154,7 +154,7 @@
 		return (ENOENT);
 
 	ruleptr = NULL;
-	if (req->newptr) {
+	if (req->newptr && req->newlen != 0) {
 		error = SYSCTL_IN(req, &temprule, sizeof(temprule));
 		if (error)
 			return (error);
@@ -178,7 +178,7 @@
 
 	if (req->newptr && req->newlen == 0) {
 		/* printf("deletion\n"); */
-		FREE(ruleptr, M_MACBSDEXTENDED);
+		KASSERT(ruleptr == NULL, ("sysctl_rule: ruleptr != NULL"));
 		ruleptr = rules[index];
 		if (ruleptr == NULL) {
 			error = ENOENT;
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