Module: kamailio
Branch: master
Commit: 7894fb470e707622b077d565763c9cfb7c654da5
URL:
https://github.com/kamailio/kamailio/commit/7894fb470e707622b077d565763c9cf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-09-16T08:37:55+02:00
dispatcher: init attrs value when param not given to rpc add
- GH #2854
---
Modified: src/modules/dispatcher/dispatcher.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7894fb470e707622b077d565763c9cf…
Patch:
https://github.com/kamailio/kamailio/commit/7894fb470e707622b077d565763c9cf…
---
diff --git a/src/modules/dispatcher/dispatcher.c b/src/modules/dispatcher/dispatcher.c
index 679acbe2aa..4ed98919b7 100644
--- a/src/modules/dispatcher/dispatcher.c
+++ b/src/modules/dispatcher/dispatcher.c
@@ -1854,7 +1854,7 @@ static void dispatcher_rpc_add(rpc_t *rpc, void *ctx)
{
int group, flags, nparams;
str dest;
- str attrs;
+ str attrs = STR_NULL;
flags = 0;
@@ -1862,7 +1862,7 @@ static void dispatcher_rpc_add(rpc_t *rpc, void *ctx)
if(nparams < 2) {
rpc->fault(ctx, 500, "Invalid Parameters");
return;
- } else if (nparams < 3) {
+ } else if (nparams <= 3) {
attrs.s = 0;
attrs.len = 0;
}