diff options
author | rwatson <rwatson@FreeBSD.org> | 2003-05-30 17:02:36 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2003-05-30 17:02:36 +0000 |
commit | 8763b56373f7b5a7372b2568dbbb387b0c53ac2c (patch) | |
tree | 0fedbf500de22d1fac618965eceb498ae5afeeff /sys/security | |
parent | 7ab0ceb36107f1b2314bd7598ab317eaf28330a8 (diff) | |
download | FreeBSD-src-8763b56373f7b5a7372b2568dbbb387b0c53ac2c.zip FreeBSD-src-8763b56373f7b5a7372b2568dbbb387b0c53ac2c.tar.gz |
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)
Diffstat (limited to 'sys/security')
-rw-r--r-- | sys/security/mac_mls/mac_mls.c | 9 |
1 files changed, 5 insertions, 4 deletions
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) || |