summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2003-04-24 05:21:45 +0000
committertedu <tedu@openbsd.org>2003-04-24 05:21:45 +0000
commitf4a4f39b30c3304eea169c4aae8c12d53f50189d (patch)
treebbd6a937dea7df5b0ee96060b597b2a56ce3cf55
parentmount_cd9660 is not normally executed at boot time; (diff)
downloadwireguard-openbsd-f4a4f39b30c3304eea169c4aae8c12d53f50189d.tar.xz
wireguard-openbsd-f4a4f39b30c3304eea169c4aae8c12d53f50189d.zip
fix bounds for strlcpy. pr3228 from Jan Johansson
-rw-r--r--usr.sbin/afs/src/lib/bufdir/fdir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/afs/src/lib/bufdir/fdir.c b/usr.sbin/afs/src/lib/bufdir/fdir.c
index 74f4634d6b1..240d337195e 100644
--- a/usr.sbin/afs/src/lib/bufdir/fdir.c
+++ b/usr.sbin/afs/src/lib/bufdir/fdir.c
@@ -287,7 +287,8 @@ add_to_page (DirPage0 *page0,
page->entry[i].next = next;
page->entry[i].fid.Vnode = htonl(fid.Vnode);
page->entry[i].fid.Unique = htonl(fid.Unique);
- strlcpy (page->entry[i].name, filename, sizeof(page->entry[i].name));
+ /* XXX find a better bound. very unusual buffer handling */
+ strlcpy (page->entry[i].name, filename, strlen(filename) + 1);
memset(page->entry[i + j - 1].fill, 0, 4);
if (pageno < MAXPAGES)
page0->dheader.map[pageno] -= n;