Module: kamailio
Branch: 5.3
Commit: c2608157108fe46231269515b8bb8ddb53d82662
URL:
https://github.com/kamailio/kamailio/commit/c2608157108fe46231269515b8bb8dd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-30T14:46:51+01:00
alias_db: set ending zero in a single place
(cherry picked from commit dc1bb5b1861de279b450ab550888dd748b77463f)
(cherry picked from commit 83005d4fafd5d055e4125a83c24d1c6cd0eed058)
---
Modified: src/modules/alias_db/alookup.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c2608157108fe46231269515b8bb8dd…
Patch:
https://github.com/kamailio/kamailio/commit/c2608157108fe46231269515b8bb8dd…
---
diff --git a/src/modules/alias_db/alookup.c b/src/modules/alias_db/alookup.c
index 28dd916999..faa5f6739e 100644
--- a/src/modules/alias_db/alookup.c
+++ b/src/modules/alias_db/alookup.c
@@ -163,19 +163,18 @@ static int alias_db_query(struct sip_msg* _msg, str table,
(char*)RES_ROWS(db_res)[i].values[1].val.str_val.s,
RES_ROWS(db_res)[i].values[1].val.str_val.len);
user_s.len += RES_ROWS(db_res)[i].values[1].val.str_val.len;
- useruri_buf[user_s.len] = '\0';
break;
case DB1_BLOB:
strncpy(user_s.s,
(char*)RES_ROWS(db_res)[i].values[1].val.blob_val.s,
RES_ROWS(db_res)[i].values[1].val.blob_val.len);
user_s.len += RES_ROWS(db_res)[i].values[1].val.blob_val.len;
- useruri_buf[user_s.len] = '\0';
break;
default:
LM_ERR("unknown type of DB user column\n");
goto err_server;
}
+ useruri_buf[user_s.len] = '\0';
user_s.s = useruri_buf;
/* set the URI */
LM_DBG("new URI [%d] is [%.*s]\n", i, user_s.len ,user_s.s );