[sr-dev] git:master:f95ede23: dmq: access val after being tested for null

Daniel-Constantin Mierla miconda at gmail.com
Fri Apr 2 10:04:44 CEST 2021


Module: kamailio
Branch: master
Commit: f95ede239474f8c3b901f83e7eb34cbfa8f0e0fd
URL: https://github.com/kamailio/kamailio/commit/f95ede239474f8c3b901f83e7eb34cbfa8f0e0fd

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-04-02T10:04:10+02:00

dmq: access val after being tested for null

---

Modified: src/modules/dmq/dmq.c

---

Diff:  https://github.com/kamailio/kamailio/commit/f95ede239474f8c3b901f83e7eb34cbfa8f0e0fd.diff
Patch: https://github.com/kamailio/kamailio/commit/f95ede239474f8c3b901f83e7eb34cbfa8f0e0fd.patch

---

diff --git a/src/modules/dmq/dmq.c b/src/modules/dmq/dmq.c
index 7d343b193b..79cc8ccbc9 100644
--- a/src/modules/dmq/dmq.c
+++ b/src/modules/dmq/dmq.c
@@ -365,14 +365,14 @@ static void destroy(void)
 static int dmq_add_notification_address(modparam_t type, void * val)
 {
 	str tmp_str;
-	tmp_str.s = ((str*) val)->s;
-	tmp_str.len = ((str*) val)->len;
 	int total_list = 0; /* not used */
 
 	if(val==NULL) {
 		LM_ERR("invalid notification address parameter value\n");
 		return -1;
 	}
+	tmp_str.s = ((str*) val)->s;
+	tmp_str.len = ((str*) val)->len;
 	if(parse_uri(tmp_str.s,  tmp_str.len, &dmq_notification_uri) < 0) {
 		LM_ERR("could not parse notification address\n");
 		return -1;




More information about the sr-dev mailing list