summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2013-05-08 06:32:07 +0000
committerbrad <brad@openbsd.org>2013-05-08 06:32:07 +0000
commit971d9addd0660bfc63159e707eb361cc52b8ba31 (patch)
tree1321fddf7735f533cad0b319535ce2bc84bebc3a
parentReduce size of some unused arrays. (diff)
downloadwireguard-openbsd-971d9addd0660bfc63159e707eb361cc52b8ba31.tar.xz
wireguard-openbsd-971d9addd0660bfc63159e707eb361cc52b8ba31.zip
Replace use of strncpy with memcpy. Previous code used strncpy on data
that is not null-terminated. From Stephane A. Sezer ok bluhm@
-rw-r--r--usr.sbin/rtadvd/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index e75bb307f1a..28ee0116b2b 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.36 2013/05/08 06:28:09 brad Exp $ */
+/* $OpenBSD: config.c,v 1.37 2013/05/08 06:32:07 brad Exp $ */
/* $KAME: config.c,v 1.62 2002/05/29 10:13:10 itojun Exp $ */
/*
@@ -872,7 +872,7 @@ make_packet(struct rainfo *rainfo)
curlabel_size = curlabel_end - curlabel_begin;
*buf++ = curlabel_size;
- strncpy(buf, curlabel_begin, curlabel_size);
+ memcpy(buf, curlabel_begin, curlabel_size);
buf += curlabel_size;
curlabel_begin = curlabel_end + 1;
}