[sr-dev] git:5.2:2d2b9936: htable: fix a possible null pointer dereference in dmq startup error case

Henning Westerholt hw at skalatan.de
Fri May 31 12:59:54 CEST 2019


Module: kamailio
Branch: 5.2
Commit: 2d2b993673d0296e6d9c08ff78b73341e407a37a
URL: https://github.com/kamailio/kamailio/commit/2d2b993673d0296e6d9c08ff78b73341e407a37a

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-05-31T12:57:56+02:00

htable: fix a possible null pointer dereference in dmq startup error case

(cherry picked from commit 6f0b67b675dd18dce60fa3e5a4ece063216bbab5)

---

Modified: src/modules/htable/ht_dmq.c

---

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

---

diff --git a/src/modules/htable/ht_dmq.c b/src/modules/htable/ht_dmq.c
index 1f27e97684..26c6eb859a 100644
--- a/src/modules/htable/ht_dmq.c
+++ b/src/modules/htable/ht_dmq.c
@@ -588,11 +588,11 @@ int ht_dmq_handle_sync(srjson_doc_t* jdoc) {
 			if(ht==NULL) {
 				LM_WARN("unable to get table %.*s\n",
 						htname.len, (htname.s)?htname.s:"");
-			}
-
-			if (ht_set_cell_ex(ht, &cname, type, &val, 0, expire - now) < 0) {
-				LM_WARN("unable to set cell %.*s in table %.*s\n",
-						cname.len, cname.s, ht->name.len, ht->name.s);
+			} else {
+				if (ht_set_cell_ex(ht, &cname, type, &val, 0, expire - now) < 0) {
+					LM_WARN("unable to set cell %.*s in table %.*s\n",
+							cname.len, cname.s, ht->name.len, ht->name.s);
+				}
 			}
 		}
 




More information about the sr-dev mailing list