aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/features/fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/features/fs.c b/kernel/features/fs.c
index c52a7b6..ceb345d 100644
--- a/kernel/features/fs.c
+++ b/kernel/features/fs.c
@@ -151,7 +151,8 @@ int find_inode(const char *name, int dir_inode)
do {
// Calculate the 4byte aligned size of each entry
sum += d->total_len;
- if (strncmp((void *)d->name, name, d->name_len) == 0) {
+ if (strlen(name) == d->name_len &&
+ strncmp((void *)d->name, name, d->name_len) == 0) {
free(buf);
return d->inode_num;
}