Module: kamailio
Branch: 5.0
Commit: 85e45cede3c463fbe8186d19a8d7d024dd42cb76
URL:
https://github.com/kamailio/kamailio/commit/85e45cede3c463fbe8186d19a8d7d02…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2019-01-11T16:10:57+01:00
cdp: fix two errors from coverty scan (missing check, var initialization)
- remove library call can fail, test for the error and log it
- initialize the msghdr variable with a memset
(cherry picked from commit 7d52bf6ce7188eaa57690766c231e55b5509db4f)
---
Modified: src/modules/cdp/receiver.c
---
Diff:
https://github.com/kamailio/kamailio/commit/85e45cede3c463fbe8186d19a8d7d02…
Patch:
https://github.com/kamailio/kamailio/commit/85e45cede3c463fbe8186d19a8d7d02…
---
diff --git a/src/modules/cdp/receiver.c b/src/modules/cdp/receiver.c
index 0ff2fe15ae..4162501f6c 100644
--- a/src/modules/cdp/receiver.c
+++ b/src/modules/cdp/receiver.c
@@ -157,10 +157,14 @@ static int make_send_pipe(serviced_peer_t *sp)
*/
static void close_send_pipe(serviced_peer_t *sp)
{
+ int tmp;
if (sp->send_pipe_name.s) {
close(sp->send_pipe_fd);
close(sp->send_pipe_fd_out);
- remove(sp->send_pipe_name.s);
+ tmp = remove(sp->send_pipe_name.s);
+ if (tmp == -1) {
+ LM_ERR("could not remove send pipe\n");
+ }
shm_free(sp->send_pipe_name.s);
sp->send_pipe_name.s=0;
sp->send_pipe_name.len=0;
@@ -269,6 +273,7 @@ static int send_fd(int pipe_fd,int fd, peer *p)
struct iovec iov[1];
int ret;
int *tmp = NULL;
+ memset(&msg, 0, sizeof(struct msghdr));
#ifdef HAVE_MSGHDR_MSG_CONTROL
struct cmsghdr* cmsg;