浏览代码

module/ims_auth: protection against crash if there is no auth vector initialised.
- patch submitted by Camille Oudot

Jason Penton 12 年之前
父节点
当前提交
4b65964dbe
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      modules/ims_auth/cxdx_mar.c

+ 6 - 4
modules/ims_auth/cxdx_mar.c

@@ -411,11 +411,13 @@ success:
         stateful_request_reply_async(t, t->uas.request, 401, MSG_401_CHALLENGE);
 
 done:
-    start_reg_await_timer(avlist[0]); //start the timer to remove stale or unused Auth Vectors
+    if (avlist) {
+        start_reg_await_timer(avlist[0]); //start the timer to remove stale or unused Auth Vectors
 
-    //now we add it to the queue as sent as we have already sent the challenge and used it and set the status to SENT
-    if (!add_auth_vector(private_identity, public_identity, avlist[0]))
-        free_auth_vector(avlist[0]);
+        //now we add it to the queue as sent as we have already sent the challenge and used it and set the status to SENT
+        if (!add_auth_vector(private_identity, public_identity, avlist[0]))
+            free_auth_vector(avlist[0]);
+    }
 
     //free memory
     if (maa) cdpb.AAAFreeMessage(&maa);