diff options
author | marius <marius@FreeBSD.org> | 2006-08-26 16:28:19 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2006-08-26 16:28:19 +0000 |
commit | e78225039a9c69ef198835329f81d719ace8df95 (patch) | |
tree | 35dc8761ddec27b1b83dfe0667904473fe5aadd4 /sys | |
parent | 28f89f9a708511af86455772c85120b9a6d60520 (diff) | |
download | FreeBSD-src-e78225039a9c69ef198835329f81d719ace8df95.zip FreeBSD-src-e78225039a9c69ef198835329f81d719ace8df95.tar.gz |
Fix another bug introduced with rev. 1.204; in vfs_donmount() if
the 'vfs_getopt(optlist, "errmsg", (void **)&errmsg, &errmsg_len)'
call fails, 'errmsg' is left uninitialized, making the later tests
against NULL meaningless, and the uses bogus. Thus initialize
'errmsg' to NULL beforehand. [1]
While at it, remove the superfluous assignment of 0 to 'errmsg_len'
if the above mentioned call fails as it's already initialized to 0.
Submitted by: Michael Plass [1]
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_mount.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 28ad687..34275c1 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -575,6 +575,7 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) int error, fstypelen, fspathlen, errmsg_len, errmsg_pos; int has_rw, has_noro; + errmsg = NULL; errmsg_len = 0; errmsg_pos = -1; has_rw = 0; @@ -586,8 +587,6 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) if (vfs_getopt(optlist, "errmsg", (void **)&errmsg, &errmsg_len) == 0) errmsg_pos = vfs_getopt_pos(optlist, "errmsg"); - else - errmsg_len = 0; /* * We need these two options before the others, |