diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-04-24 05:21:46 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-04-24 05:21:46 +0000 |
commit | 99deff88bd52bfe108a015c5131956060906cf29 (patch) | |
tree | c79c01a6afc4498c137c08f348d43c8541a09d78 /usr.sbin/afs | |
parent | e820a5c952efe1c0078e85a2cae790591dc210fe (diff) |
fix bounds for strlcpy. pr3228 from Jan Johansson
Diffstat (limited to 'usr.sbin/afs')
-rw-r--r-- | usr.sbin/afs/src/lib/bufdir/fdir.c | 3 |
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; |