summaryrefslogtreecommitdiff
path: root/kernel/ztd-eth.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 /kernel/ztd-eth.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 'kernel/ztd-eth.c')
-rw-r--r--kernel/ztd-eth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/ztd-eth.c b/kernel/ztd-eth.c
index 97d3492..dfda1f0 100644
--- a/kernel/ztd-eth.c
+++ b/kernel/ztd-eth.c
@@ -316,12 +316,12 @@ static void *ztdeth_create(struct zt_span *span, char *addr)
memset(z, 0, sizeof(struct ztdeth));
/* Address should be <dev>/<macaddr>[/subaddr] */
- strncpy(tmp, addr, sizeof(tmp) - 1);
+ zap_copy_string(tmp, addr, sizeof(tmp));
tmp2 = strchr(tmp, '/');
if (tmp2) {
*tmp2 = '\0';
tmp2++;
- strncpy(z->ethdev, tmp, sizeof(z->ethdev) - 1);
+ zap_copy_string(z->ethdev, tmp, sizeof(z->ethdev));
} else {
printk("Invalid TDMoE address (no device) '%s'\n", addr);
kfree(z);