Windows: Apply cm_GetVolServerList() to cm_ConnFromVolume()

Use cm_GetVolServerList() in cm_ConnFromVolume() to ensure an
error is returned instead of dereferencing a NULL pointer if
the serverRef list for the requested volume cannot be obtained.

Change-Id: I265b7e8b64fcf6b4444c7d504e5109d67fa48089
Reviewed-on: http://gerrit.openafs.org/7724
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-07-05 18:22:24 -04:00
parent 4e3400414f
commit 3b3b620a03

View File

@ -1709,7 +1709,9 @@ long cm_ConnFromVolume(struct cm_volume *volp, unsigned long volid, struct cm_us
*connpp = NULL; *connpp = NULL;
serverspp = cm_GetVolServers(volp, volid, userp, reqp, &replicated); code = cm_GetVolServerList(volp, volid, userp, reqp, &replicated, &serverspp);
if (code)
return code;
code = cm_ConnByMServers(*serverspp, replicated, userp, reqp, connpp); code = cm_ConnByMServers(*serverspp, replicated, userp, reqp, connpp);
cm_FreeServerList(serverspp, 0); cm_FreeServerList(serverspp, 0);