You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The overflow would not be panic in release build, but results in another panic where the push operation exceeds capacity of relative_path with depth = 2**32 - 1.
Also, I found the use of Path and str very confusing. Maybe it needs to be unified?
The text was updated successfully, but these errors were encountered:
Yesterday17
changed the title
path_symlink panics when old_path is relative and does not contain ./ prefixpath_symlink panics when old_path is relative
Oct 15, 2022
Assume we're calling
path_symlink("testing", 1234, "/test-target")
.wasmer/lib/wasi/src/syscalls/mod.rs
Lines 2826 to 2829 in 03e8911
source_inode
is got fromget_parent_inode_at_path
:wasmer/lib/wasi/src/state/mod.rs
Lines 1274 to 1294 in 5db56ce
Here
path
istesting
, so we gotcomponents = Components([Normal("testing")])
, So:new_entity_name
=testing
parent_dir
=""
Since
parent_dir
is empty,get_inode_at_path
returnsbase
directly.wasmer/lib/wasi/src/syscalls/mod.rs
Lines 2830 to 2833 in 03e8911
So
source_inode
andfd
here are actually referring the same thing.path_depth_from_fd
return0
. The minus opration causes overflow.wasmer/lib/wasi/src/syscalls/mod.rs
Lines 2861 to 2865 in 03e8911
The overflow would not be panic in release build, but results in another panic where the
push
operation exceeds capacity ofrelative_path
withdepth = 2**32 - 1
.Also, I found the use of
Path
andstr
very confusing. Maybe it needs to be unified?The text was updated successfully, but these errors were encountered: