summaryrefslogtreecommitdiff
path: root/kernel/wct4xxp
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/wct4xxp
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/wct4xxp')
-rw-r--r--kernel/wct4xxp/base.c2
-rw-r--r--kernel/wct4xxp/wct4xxp-diag.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/kernel/wct4xxp/base.c b/kernel/wct4xxp/base.c
index 0b4a2d9..13fc2ae 100644
--- a/kernel/wct4xxp/base.c
+++ b/kernel/wct4xxp/base.c
@@ -1535,7 +1535,7 @@ static void init_spans(struct t4 *wc)
snprintf(ts->span.desc, sizeof(ts->span.desc) - 1,
"T%dXXP (PCI) Card %d Span %d", wc->numspans, wc->num, x+1);
ts->span.manufacturer = "Digium";
- strncpy(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype) - 1);
+ zap_copy_string(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype));
if (wc->vpm == T4_VPM_PRESENT) {
if (!wc->vpm450m)
strncat(ts->span.devicetype, " with VPM400M", sizeof(ts->span.devicetype) - 1);
diff --git a/kernel/wct4xxp/wct4xxp-diag.c b/kernel/wct4xxp/wct4xxp-diag.c
index 50a328d..8c14611 100644
--- a/kernel/wct4xxp/wct4xxp-diag.c
+++ b/kernel/wct4xxp/wct4xxp-diag.c
@@ -378,7 +378,7 @@ int main(int argc, char *argv[])
exit(1);
}
if (*(argv[1]) == '/')
- strncpy(fn, argv[1], sizeof(fn) - 1);
+ zap_copy_string(fn, argv[1], sizeof(fn));
else
snprintf(fn, sizeof(fn), "/dev/zap/%d", atoi(argv[1]));
fd = open(fn, O_RDWR);