Date: Thu, 11 Oct 2012 08:18:28 +0000 (UTC) From: Stefan Farfeleder <stefanf@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241441 - head/lib/libc/gen Message-ID: <201210110818.q9B8ISSE086763@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: stefanf Date: Thu Oct 11 08:18:28 2012 New Revision: 241441 URL: http://svn.freebsd.org/changeset/base/241441 Log: Fix my last commit. Only call strunvis after properly checking the argument is not NULL. Modified: head/lib/libc/gen/fstab.c Modified: head/lib/libc/gen/fstab.c ============================================================================== --- head/lib/libc/gen/fstab.c Thu Oct 11 07:54:29 2012 (r241440) +++ head/lib/libc/gen/fstab.c Thu Oct 11 08:18:28 2012 (r241441) @@ -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') ;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210110818.q9B8ISSE086763>