Module: kamailio
Branch: master
Commit: b81068ebbbde47196ab2f181e849154cc7877969
URL:
https://github.com/kamailio/kamailio/commit/b81068ebbbde47196ab2f181e849154…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2018-09-28T14:42:44+02:00
mohqueue: use memcpy() instead of strncpy()
mohq_funcs.c: In function 'notify_msg':
mohq_funcs.c:1475:3: warning: 'strncpy' output truncated before terminating nul
copying 2 bytes from a string of the same length [-Wstringop-truncation]
strncpy (&pbody->s [pbody->len], SIPEOL, 2);
---
Modified: src/modules/mohqueue/mohq_funcs.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b81068ebbbde47196ab2f181e849154…
Patch:
https://github.com/kamailio/kamailio/commit/b81068ebbbde47196ab2f181e849154…
---
diff --git a/src/modules/mohqueue/mohq_funcs.c b/src/modules/mohqueue/mohq_funcs.c
index 50eb9bfca0..96bdb335d0 100644
--- a/src/modules/mohqueue/mohq_funcs.c
+++ b/src/modules/mohqueue/mohq_funcs.c
@@ -1469,10 +1469,10 @@ if (!pbody->s)
LM_ERR ("%sNo more memory!\n", pfncname);
return;
}
-strncpy (pbody->s, pfrag, pbody->len);
+memcpy (pbody->s, pfrag, pbody->len);
if (pbody->s [pbody->len - 1] != '\n')
{
- strncpy (&pbody->s [pbody->len], SIPEOL, 2);
+ memcpy (&pbody->s [pbody->len], SIPEOL, 2);
pbody->len += 2;
}
struct msg_start pstart [1];