Module: kamailio
Branch: master
Commit: 46d3a3ef2314f3177d64beab466401104d3ff887
URL:
https://github.com/kamailio/kamailio/commit/46d3a3ef2314f3177d64beab4664011…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: lazedo <luis.azedo(a)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/46d3a3ef2314f3177d64beab4664011…
Patch:
https://github.com/kamailio/kamailio/commit/46d3a3ef2314f3177d64beab4664011…
---
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);