From 8763b56373f7b5a7372b2568dbbb387b0c53ac2c Mon Sep 17 00:00:00 2001 From: rwatson Date: Fri, 30 May 2003 17:02:36 +0000 Subject: Make sure all character pointers are properly initialized; this was mismerged from the MAC tree, and didn't get picked up because warnings are not normally fatal in per-module builds, only when they are linked into a kernel (such as LINT). Reported by: des and the technicolor tinderbox Approved by: re (scottl) --- sys/security/mac_mls/mac_mls.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys/security/mac_mls') diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c index 6501f9c..bd595b5 100644 --- a/sys/security/mac_mls/mac_mls.c +++ b/sys/security/mac_mls/mac_mls.c @@ -672,14 +672,12 @@ mac_mls_parse_element(struct mac_mls_element *element, char *string) static int mac_mls_parse(struct mac_mls *mac_mls, char *string) { - char *range, *rangeend, *rangehigh, *rangelow, *single; + char *rangehigh, *rangelow, *single; int error; single = strsep(&string, "("); - if (string == NULL) { - string = single; + if (*single == '\0') single = NULL; - } if (string != NULL) { rangelow = strsep(&string, "-"); @@ -690,6 +688,9 @@ mac_mls_parse(struct mac_mls *mac_mls, char *string) return (EINVAL); if (*string != '\0') return (EINVAL); + } else { + rangelow = NULL; + rangehigh = NULL; } KASSERT((rangelow != NULL && rangehigh != NULL) || -- cgit v1.1