[sr-dev] git:master:a8eed67b: imc: use memcpy() instead of strncpy()
Victor Seva
linuxmaniac at torreviejawireless.org
Fri Sep 28 14:42:49 CEST 2018
Module: kamailio
Branch: master
Commit: a8eed67b8076fd931ffa74691d3275f4003c3021
URL: https://github.com/kamailio/kamailio/commit/a8eed67b8076fd931ffa74691d3275f4003c3021
Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2018-09-28T14:42:44+02:00
imc: use memcpy() instead of strncpy()
> imc_cmd.c: In function 'imc_handle_list':
> imc_cmd.c:810:2: warning: 'strncpy' output truncated before terminating nul copying 9 bytes from a string of the same length [-Wstringop-truncation]
> strncpy(p, "Members:\n", 9);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
---
Modified: src/modules/imc/imc_cmd.c
---
Diff: https://github.com/kamailio/kamailio/commit/a8eed67b8076fd931ffa74691d3275f4003c3021.diff
Patch: https://github.com/kamailio/kamailio/commit/a8eed67b8076fd931ffa74691d3275f4003c3021.patch
---
diff --git a/src/modules/imc/imc_cmd.c b/src/modules/imc/imc_cmd.c
index 1514e2c956..a6288610a6 100644
--- a/src/modules/imc/imc_cmd.c
+++ b/src/modules/imc/imc_cmd.c
@@ -807,7 +807,7 @@ int imc_handle_list(struct sip_msg* msg, imc_cmd_t *cmd,
goto error;
}
p = imc_body_buf;
- strncpy(p, "Members:\n", 9);
+ memcpy(p, "Members:\n", 9);
p+=9;
imp = room->members;
More information about the sr-dev
mailing list