PERFORCE change 19550 for review
Robert Watson
rwatson at freebsd.org
Fri Oct 18 17:08:06 GMT 2002
http://perforce.freebsd.org/chv.cgi?CH=19550
Change 19550 by rwatson at rwatson_tislabs on 2002/10/18 10:07:42
Minor cleanup: <= instead of <, remember to free the context,
etc.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#44 edit
Differences ...
==== //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#44 (text+ko) ====
@@ -1061,19 +1061,18 @@
(*claimed)++;
- error = security_sid_to_context(sid, &context,
- &context_len);
+ error = security_sid_to_context(sid, &context, &context_len);
if (error)
return (error);
- if (size < context_len)
- return (EINVAL);
-
- *len = strlcpy(element_data, context, size);
- if (*len <= size)
- return (EINVAL);
-
- return (0);
+ if (size <= context_len) {
+ error = EINVAL;
+ else {
+ *len = strlcpy(element_data, context, size);
+ error = 0;
+ }
+ security_free_context(context);
+ return (error);
}
static int
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