Windows: Protect against cm_GetVolServerList failures
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 1 Jun 2013 04:48:51 +0000 (00:48 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 2 Jun 2013 00:52:46 +0000 (17:52 -0700)
In cm_Analyze, if cm_GetVolServerList() fails volServerpp will be
NULL which will trigger an exception if passed to either
cm_SetServerBusyStatus or cm_ResetServerBusyStatus.

Change-Id: I75b4b855b8c3ccfc014532b0c2eb3135807647ef
Reviewed-on: http://gerrit.openafs.org/9960
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_conn.c

index eb8fd3b..e14ac05 100644 (file)
@@ -508,7 +508,8 @@ cm_Analyze(cm_conn_t *connp,
                     if (code == 0)
                         free_svr_list = 1;
                 }
-                cm_ResetServerBusyStatus(volServerspp);
+                if (volServerspp)
+                    cm_ResetServerBusyStatus(volServerspp);
                 if (free_svr_list) {
                     cm_FreeServerList(volServerspp, 0);
                     free_svr_list = 0;
@@ -559,7 +560,8 @@ cm_Analyze(cm_conn_t *connp,
                     if (code == 0)
                         free_svr_list = 1;
                 }
-                cm_ResetServerBusyStatus(volServerspp);
+                if (volServerspp)
+                    cm_ResetServerBusyStatus(volServerspp);
                 if (free_svr_list) {
                     cm_FreeServerList(volServerspp, 0);
                     free_svr_list = 0;
@@ -651,7 +653,8 @@ cm_Analyze(cm_conn_t *connp,
             osi_Log3(afsd_logp, format, osi_LogSaveString(afsd_logp,addr), fidp->volume, cellp->name);
             LogEvent(EVENTLOG_WARNING_TYPE, msgID, addr, fidp->volume, cellp->name);
 
-            cm_SetServerBusyStatus(volServerspp, serverp);
+            if (volServerspp)
+                cm_SetServerBusyStatus(volServerspp, serverp);
         }
 
         if (free_svr_list) {