summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2012-10-11 08:18:28 +0000
committerstefanf <stefanf@FreeBSD.org>2012-10-11 08:18:28 +0000
commit61816f86e167fba086e2c2d4a8dd9a2f318d1b26 (patch)
tree1e98ab2a9ea329e42b890c05482bf412462a72bd
parent054e35b9ef9943ad6326092f93b873b1495d9540 (diff)
downloadFreeBSD-src-61816f86e167fba086e2c2d4a8dd9a2f318d1b26.zip
FreeBSD-src-61816f86e167fba086e2c2d4a8dd9a2f318d1b26.tar.gz
Fix my last commit. Only call strunvis after properly checking the argument is
not NULL.
-rw-r--r--lib/libc/gen/fstab.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index 1351a27..b68db2e 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -150,16 +150,18 @@ fstabscan(void)
/* OLD_STYLE_FSTAB */
while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0')
;
- if (strunvis(cp, cp) < 0)
- goto bad;
_fs_fstab.fs_spec = cp;
- if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#')
+ if (_fs_fstab.fs_spec == NULL || *_fs_fstab.fs_spec == '#')
continue;
+ if (strunvis(_fs_fstab.fs_spec, _fs_fstab.fs_spec) < 0)
+ goto bad;
while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0')
;
- if (strunvis(cp, cp) < 0)
- goto bad;
_fs_fstab.fs_file = cp;
+ if (_fs_fstab.fs_file == NULL)
+ goto bad;
+ if (strunvis(_fs_fstab.fs_file, _fs_fstab.fs_file) < 0)
+ goto bad;
fixfsfile();
while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0')
;
OpenPOWER on IntegriCloud