summaryrefslogtreecommitdiffstats
path: root/usr.bin/checknr
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1995-06-30 04:59:44 +0000
committerasami <asami@FreeBSD.org>1995-06-30 04:59:44 +0000
commit9a52e662ef72224585024e3668e4686fde71cef3 (patch)
tree3e45d3b7cf1b800d55dfa012fb7f9a8b7a1e447f /usr.bin/checknr
parentab0556306c1f235d6802383fa167ac7151ead7b9 (diff)
downloadFreeBSD-src-9a52e662ef72224585024e3668e4686fde71cef3.zip
FreeBSD-src-9a52e662ef72224585024e3668e4686fde71cef3.tar.gz
Terminate string copied by strncpy() by '\0' to fix a core dump.
Submitted by: kogane@kces.koganemaru.co.jp (Nobuyuki Koganemaru)
Diffstat (limited to 'usr.bin/checknr')
-rw-r--r--usr.bin/checknr/checknr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c
index 774d3b0..336eb67 100644
--- a/usr.bin/checknr/checknr.c
+++ b/usr.bin/checknr/checknr.c
@@ -216,6 +216,7 @@ char **argv;
if (cp[2] && cp[2] != '.')
usage();
strncpy(b1, cp, 2);
+ b1[2] = '\0';
addmac(b1);
}
break;
OpenPOWER on IntegriCloud