From d88c03492d1ea9a7533298977d8d6bec5e91ebcd Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 30 Sep 2009 16:42:46 -0500 Subject: [PATCH] DAFS: Avoid volserver segfault in GetVolInfo It is possible for GetVolObject to return success, but result in a NULL fs_tv. In particular, when the fileserver responds with FSYNC_WRONG_PART or FSYNC_UNKNOWN_VOLID. It is possible, though difficult, for the fileserver to respond with FSYNC_UNKNOWN_VOLID if the requested volume hasn't been preattached on the fileserver yet. So, in GetVolInfo, also check fs_tv, so we don't try to dereference it later. Reviewed-on: http://gerrit.openafs.org/562 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/volser/volprocs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 3f35ca982..4e6b588af 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -2155,7 +2155,8 @@ GetVolInfo(afs_uint32 partId, #ifdef AFS_DEMAND_ATTACH_FS /* If using DAFS, get volume from fsserver */ - if (GetVolObject(volumeId, pname, &fs_tv) != SYNC_OK) { + if (GetVolObject(volumeId, pname, &fs_tv) != SYNC_OK || fs_tv == NULL) { + goto drop; } -- 2.39.5