Skip to content

Commit 3dda4f1

Browse files
committed
added additional sanity check in mount
1 parent 8828f92 commit 3dda4f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/libc/unix/_mount.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ int _mount(char *user_name, struct vfs *v)
208208
#endif
209209
return -1;
210210
}
211-
if (user_name[0] != '/' || strlen(user_name) > MAX_MOUNT_CHARS) {
211+
if ( !(user_name[0] == '/' && user_name[1] != 0)
212+
|| strlen(user_name) > MAX_MOUNT_CHARS) {
212213
#ifdef _DEBUG
213214
__builtin_printf("mount %s: EINVAL\n", user_name);
214215
#endif

0 commit comments

Comments
 (0)