diff options
-rw-r--r-- | usr.sbin/afs/src/lib/bufdir/fdir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/afs/src/lib/bufdir/fdir.c b/usr.sbin/afs/src/lib/bufdir/fdir.c index 240d337195e..3c453e0e90e 100644 --- a/usr.sbin/afs/src/lib/bufdir/fdir.c +++ b/usr.sbin/afs/src/lib/bufdir/fdir.c @@ -287,8 +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); - /* XXX find a better bound. very unusual buffer handling */ - strlcpy (page->entry[i].name, filename, strlen(filename) + 1); + strlcpy (page->entry[i].name, filename, (n - 1) * sizeof(DirEntry) + + sizeof(page->entry[i].name)); memset(page->entry[i + j - 1].fill, 0, 4); if (pageno < MAXPAGES) page0->dheader.map[pageno] -= n; |