[sr-dev] git:master:46d3a3ef: db_text: fix bug in raw query where clause

lazedo luis.azedo at factorlusitano.com
Fri Jan 8 03:52:10 CET 2016


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

Author: lazedo <luis.azedo at factorlusitano.com>
Committer: lazedo <luis.azedo at factorlusitano.com>
Date: 2016-01-08T02:52:04Z

db_text: fix bug in raw query where clause

wrong type was allocated

---

Modified: modules/db_text/dbt_raw_util.c

---

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

---

diff --git a/modules/db_text/dbt_raw_util.c b/modules/db_text/dbt_raw_util.c
index ffbfa3b..9b0e2d7 100644
--- a/modules/db_text/dbt_raw_util.c
+++ b/modules/db_text/dbt_raw_util.c
@@ -216,7 +216,7 @@ int dbt_build_where(char* where, db_key_t** _k, db_op_t** _o, db_val_t** _v)
 		//      needs changes in dbt_query / dbt_row_match
 
 		l = matches[2].rm_eo - matches[2].rm_so;
-		_k1[idx] = pkg_malloc(sizeof(db_key_t));
+		_k1[idx] = pkg_malloc(sizeof(str));
 		_k1[idx]->len = l;
 		_k1[idx]->s = pkg_malloc(sizeof(char) * (l+1));
 		strncpy(_k1[idx]->s, buffer+matches[2].rm_so, l);




More information about the sr-dev mailing list