summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sethdlc-new.c2
-rw-r--r--sethdlc.c2
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);