Module: kamailio
Branch: master
Commit: dca29a87467fd074bcb63a5f20b6834a87fadc5f
URL:
https://github.com/kamailio/kamailio/commit/dca29a87467fd074bcb63a5f20b6834…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-12-01T09:02:12+01:00
db_mongodb: use STR_VTOZ() macro
---
Modified: src/modules/ndb_mongodb/mongodb_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/dca29a87467fd074bcb63a5f20b6834…
Patch:
https://github.com/kamailio/kamailio/commit/dca29a87467fd074bcb63a5f20b6834…
---
diff --git a/src/modules/ndb_mongodb/mongodb_client.c
b/src/modules/ndb_mongodb/mongodb_client.c
index 94d1b87500b..6f4818a712f 100644
--- a/src/modules/ndb_mongodb/mongodb_client.c
+++ b/src/modules/ndb_mongodb/mongodb_client.c
@@ -252,14 +252,13 @@ int mongodbc_exec_cmd(
mongoc_client_get_collection(rsrv->client, dname->s, cname->s);
LM_DBG("trying to execute: [[%.*s]]\n", cmd->len, cmd->s);
- c = cmd->s[cmd->len];
- cmd->s[cmd->len] = '\0';
+ STR_VTOZ(cmd->s[cmd->len], c);
if(!bson_init_from_json(&command, cmd->s, cmd->len, &error)) {
cmd->s[cmd->len] = c;
LM_ERR("Failed to run command: %s\n", error.message);
goto error_exec;
}
- cmd->s[cmd->len] = c;
+ STR_ZTOV(cmd->s[cmd->len], c);
if(emode == 0) {
ret = mongoc_collection_command_simple(
rpl->collection, &command, NULL, &reply, &error);