mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-22 17:54:52 +00:00
Fix a stupid bug where I wasn't initializing the names
of 0-length mount options.
This commit is contained in:
parent
ef594d3186
commit
dae0abedbd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100631
|
@ -226,21 +226,22 @@ vfs_buildopts(struct uio *auio, struct vfsoptlist **options)
|
|||
namelen = auio->uio_iov[i].iov_len;
|
||||
optlen = auio->uio_iov[i + 1].iov_len;
|
||||
opt->name = malloc(namelen, M_MOUNT, M_WAITOK);
|
||||
opt->len = optlen;
|
||||
if (optlen == 0) {
|
||||
opt->value = NULL;
|
||||
opt->value = NULL;
|
||||
if (auio->uio_segflg == UIO_SYSSPACE) {
|
||||
bcopy(auio->uio_iov[i].iov_base, opt->name, namelen);
|
||||
} else {
|
||||
error = copyin(auio->uio_iov[i].iov_base, opt->name,
|
||||
namelen);
|
||||
if (error)
|
||||
goto bad;
|
||||
}
|
||||
opt->len = optlen;
|
||||
if (optlen != 0) {
|
||||
opt->value = malloc(optlen, M_MOUNT, M_WAITOK);
|
||||
if (auio->uio_segflg == UIO_SYSSPACE) {
|
||||
bcopy(auio->uio_iov[i].iov_base, opt->name,
|
||||
namelen);
|
||||
bcopy(auio->uio_iov[i + 1].iov_base, opt->value,
|
||||
optlen);
|
||||
} else {
|
||||
error = copyin(auio->uio_iov[i].iov_base,
|
||||
opt->name, namelen);
|
||||
if (error)
|
||||
goto bad;
|
||||
error = copyin(auio->uio_iov[i + 1].iov_base,
|
||||
opt->value, optlen);
|
||||
if (error)
|
||||
|
|
Loading…
Reference in a new issue