Browse code

auth_ephemeral: re-ordered code so access to sip msg is done after NULL check

(cherry picked from commit a471e4723206cdce7e9e319af344145b92444698)

Daniel-Constantin Mierla authored on 03/11/2016 11:55:31
Showing 1 changed files
... ...
@@ -334,17 +334,17 @@ int autheph_www2(struct sip_msg *_m, char *_realm, char *_method)
334 334
 		return AUTH_ERROR;
335 335
 	}
336 336
 
337
-	if (_m->REQ_METHOD == METHOD_ACK || _m->REQ_METHOD == METHOD_CANCEL)
338
-	{
339
-		return AUTH_OK;
340
-	}
341
-
342 337
 	if(_m == NULL || _realm == NULL)
343 338
 	{
344 339
 		LM_ERR("invalid parameters\n");
345 340
 		return AUTH_ERROR;
346 341
 	}
347 342
 
343
+	if (_m->REQ_METHOD == METHOD_ACK || _m->REQ_METHOD == METHOD_CANCEL)
344
+	{
345
+		return AUTH_OK;
346
+	}
347
+
348 348
 	if (get_str_fparam(&srealm, _m, (fparam_t*)_realm) < 0)
349 349
 	{
350 350
 		LM_ERR("failed to get realm value\n");