zaptel/0001-Fixed-potential-buffer-overflow.patch
Jeffrey C. Ollie f89d2aad3a Update to 1.4.6
2007-11-03 05:31:25 +00:00

44 lines
1.3 KiB
Diff

From 4c9b832d29f81a2f90b2bd8a29f5be90fd599495 Mon Sep 17 00:00:00 2001
From: mmichelson <mmichelson@f558416c-6c06-0410-9f27-dde2687782d0>
Date: Wed, 31 Oct 2007 21:08:15 +0000
Subject: [PATCH] Fixed potential buffer overflow.
See AST-2007-024 for more details
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3205 f558416c-6c06-0410-9f27-dde2687782d0
---
sethdlc-new.c | 2 +-
sethdlc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sethdlc-new.c b/sethdlc-new.c
index 4a4a7bb..1765c32 100644
--- a/sethdlc-new.c
+++ b/sethdlc-new.c
@@ -673,7 +673,7 @@ int main(int arg_c, char *arg_v[])
if (sock < 0)
error("Unable to create socket: %s\n", strerror(errno));
- strcpy(req.ifr_name, argv[1]); /* Device name */
+ strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name) - 1); /* Device name */
if (argc == 2)
show_port();
diff --git a/sethdlc.c b/sethdlc.c
index 3514b2e..afbcb20 100644
--- a/sethdlc.c
+++ b/sethdlc.c
@@ -293,7 +293,7 @@ int main(int argc, char *argv[])
if (sock<0)
error("Unable to create socket: %s\n", strerror(errno));
- strcpy(req.ifr_name, argv[1]); /* Device name */
+ strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name) - 1); /* Device name */
if (argc == 2) {
show_port(sock);
--
1.5.3.3