Module: kamailio
Branch: master
Commit: d5dd30ead60633392dc33f90af300a4655d91b56
URL:
https://github.com/kamailio/kamailio/commit/d5dd30ead60633392dc33f90af300a4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-06-10T13:09:37+02:00
Merge pull request #199 from kamailio/lazedo-patch-1
db_text : missing conversion in raw query
---
Modified: modules/db_text/dbt_raw_util.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d5dd30ead60633392dc33f90af300a4…
Patch:
https://github.com/kamailio/kamailio/commit/d5dd30ead60633392dc33f90af300a4…
---
diff --git a/modules/db_text/dbt_raw_util.c b/modules/db_text/dbt_raw_util.c
index a35bacb..1efe9bd 100644
--- a/modules/db_text/dbt_raw_util.c
+++ b/modules/db_text/dbt_raw_util.c
@@ -171,6 +171,7 @@ int dbt_build_where(char* where, db_key_t** _k, db_op_t** _o,
db_val_t** _v)
regex_t preg;
int offset = 0;
int idx = -1;
+ char int_buf[50];
*_k = NULL;
*_o = NULL;
@@ -225,8 +226,10 @@ int dbt_build_where(char* where, db_key_t** _k, db_op_t** _o,
db_val_t** _v)
l = matches[5].rm_eo - matches[5].rm_so;
if(matches[4].rm_so == -1) {
+ strncpy(int_buf, buffer+matches[5].rm_so, l);
+ int_buf[l] = '\0';
_v1[idx].type = DB1_INT;
- _v1[idx].val.int_val = 0;
+ _v1[idx].val.int_val = atoi(int_buf);
} else {
_v1[idx].type = DB1_STR;
_v1[idx].val.str_val.len = l;