1.1 --- a/libfsserver/lib/directories/ext2_directory_accessor.cc Thu Sep 15 18:57:10 2022 +0200
1.2 +++ b/libfsserver/lib/directories/ext2_directory_accessor.cc Thu Sep 15 18:57:55 2022 +0200
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * An object for a directory provided by an Ext2-compatible filesystem.
1.6 *
1.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -53,7 +53,7 @@
1.13
1.14 static int pad_align(int value)
1.15 {
1.16 - return value + (sizeof(unsigned int) - (value % sizeof(unsigned int)));
1.17 + return value + (sizeof(l4_umword_t) - (value % sizeof(l4_umword_t)));
1.18 }
1.19
1.20 /* Callback function. */
1.21 @@ -120,6 +120,8 @@
1.22 char buffer[reclen];
1.23 struct dirent *dirent = (struct dirent *) buffer;
1.24
1.25 + memset(dirent, 0, reclen);
1.26 +
1.27 dirent->d_ino = dir->entry->inode;
1.28 dirent->d_off = dir->offset;
1.29 dirent->d_reclen = reclen;
1.30 @@ -128,7 +130,6 @@
1.31 /* Copy the name, padding the memory after it to the alignment boundary. */
1.32
1.33 memcpy(dirent->d_name, dir->entry->name, namelen);
1.34 - memset(dirent->d_name + namelen, 0, reclen - namelen);
1.35
1.36 /* Write the structure to the pipe. */
1.37