diff --git a/pkg/lwext4/fs/lwext4_fs.c b/pkg/lwext4/fs/lwext4_fs.c index d239089c45..5314925d20 100644 --- a/pkg/lwext4/fs/lwext4_fs.c +++ b/pkg/lwext4/fs/lwext4_fs.c @@ -462,6 +462,7 @@ static int _readdir(vfs_DIR *dirp, vfs_dirent_t *entry) } strncpy(entry->d_name, (char *)dirent->name, sizeof(entry->d_name)); + entry->d_name[sizeof(entry->d_name) - 1] = '\0'; return 1; }