From: Andrew Deason Date: Wed, 30 Sep 2009 21:42:46 +0000 (-0500) Subject: DAFS: Avoid volserver segfault in GetVolInfo X-Git-Tag: openafs-devel-1_5_66~132 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d88c03492d1ea9a7533298977d8d6bec5e91ebcd;p=packages%2Fo%2Fopenafs.git 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 --- 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; }