volser: don't derefernce null pointer in copyVnodes()

split_volume() can call copyVnodes() with parVnode == NULL, so guard
the one reference to parVnode (a memcpy()) to avoid a fault.

Change-Id: I631a78bcfa6a7a465e997a6714849ca0d2d86f86
Reviewed-on: http://gerrit.openafs.org/7769
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Garrett Wollman 2012-07-15 15:13:55 -04:00 committed by Derrick Brashear
parent d2d591caf2
commit 3af6beea4b

View File

@ -375,7 +375,8 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol,
code = EIO;
goto Bad_Copy;
}
memcpy(parVnode, vnode, sizeof(struct VnodeDiskObject));
if (parVnode != NULL)
memcpy(parVnode, vnode, sizeof(struct VnodeDiskObject));
}
if (e->flag & NEEDED && e->vN != where) {
VNDISK_GET_LEN(size, vnode);