server/rump_fs: local symlink target termination
Clients may write symlink targets with or without null-termination. Fixes #2043
This commit is contained in:
committed by
Christian Helmuth
parent
f92be575ae
commit
7547820af6
@@ -53,7 +53,10 @@ class File_system::Symlink : public Node
|
||||
if (!_create || seek_offset)
|
||||
return 0;
|
||||
|
||||
int ret = rump_sys_symlink(src, _path.base());
|
||||
/* src may not be null-terminated */
|
||||
Genode::String<MAX_PATH_LEN> target(src, len);
|
||||
|
||||
int ret = rump_sys_symlink(target.string(), _path.base());
|
||||
return ret == -1 ? 0 : ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user