Module: kamailio
Branch: 5.1
Commit: edb3c0abfc2712aef8e6ec562aa0d2170dc81120
URL:
https://github.com/kamailio/kamailio/commit/edb3c0abfc2712aef8e6ec562aa0d21…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-12-08T16:54:38+01:00
db2_ops: safety check for input parameter
(cherry picked from commit 1be7a6903ace085e7518fa0d358a4ca899ee938f)
---
Modified: src/modules/db2_ops/db2_ops.c
Modified: src/modules/jsonrpcc/jsonrpc_io.c
---
Diff:
https://github.com/kamailio/kamailio/commit/edb3c0abfc2712aef8e6ec562aa0d21…
Patch:
https://github.com/kamailio/kamailio/commit/edb3c0abfc2712aef8e6ec562aa0d21…
---
diff --git a/src/modules/db2_ops/db2_ops.c b/src/modules/db2_ops/db2_ops.c
index 647faceb1c..dca2c81a1c 100644
--- a/src/modules/db2_ops/db2_ops.c
+++ b/src/modules/db2_ops/db2_ops.c
@@ -201,6 +201,9 @@ static int split_fields(char *part, int *n, struct xlstr **strs) {
int i, res;
char *c, *fld;
+ if(part==NULL || *part=='\0')
+ return -1;
+
*n = 0;
*strs = 0;
c = part;
diff --git a/src/modules/jsonrpcc/jsonrpc_io.c b/src/modules/jsonrpcc/jsonrpc_io.c
index ae96ace9c0..ddefd1b3a1 100644
--- a/src/modules/jsonrpcc/jsonrpc_io.c
+++ b/src/modules/jsonrpcc/jsonrpc_io.c
@@ -219,6 +219,7 @@ void cmd_pipe_cb(int fd, short event, void *arg)
if (timerfd_settime(timerfd, 0, itime, NULL) == -1)
{
LM_ERR("Could not set timer.");
+ pkg_free(itime);
goto error;
}
pkg_free(itime);