From 3b3b620a03b56dba7f0696f8175b9fb2c8fbd6ae Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 5 Jul 2012 18:22:24 -0400 Subject: [PATCH] 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 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_conn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 3043d5d492..21044e4540 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -1709,7 +1709,9 @@ long cm_ConnFromVolume(struct cm_volume *volp, unsigned long volid, struct cm_us *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); cm_FreeServerList(serverspp, 0);