summaryrefslogtreecommitdiff
path: root/fxotune.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-02-18 17:32:26 +0000
committerjpeeler <jpeeler@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-02-18 17:32:26 +0000
commit23a324c0a98aba6d1bd13718d0d49d503c5987e0 (patch)
tree726099eee04498d137f1d9a3da25c8bd6067a10f /fxotune.c
parent517b95c8dd353100be49168eee07fc8966db23c2 (diff)
Closes issue #11471. Replaced instances of strncpy with zap_copy_string (added to zaptel.h) to fix any off by one errors and ensure destination string is NULL terminated.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3846 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'fxotune.c')
-rw-r--r--fxotune.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fxotune.c b/fxotune.c
index bf8b6af..d7ee9ca 100644
--- a/fxotune.c
+++ b/fxotune.c
@@ -167,7 +167,8 @@ static int ensure_silence(struct silence_info *info)
memset(&dop, 0, sizeof(dop));
dop.op = ZT_DIAL_OP_REPLACE;
dop.dialstr[0] = 'T';
- strncpy(dop.dialstr + 1, info->dialstr, sizeof(dop.dialstr) - 1);
+ zap_copy_string(dop.dialstr + 1, info->dialstr, sizeof(dop.dialstr));
+
if (ioctl(info->device, ZT_DIAL, &dop)) {
fprintf(stderr, "Unable to dial!\n");