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
Third bug converts the executed program and its arguments to String, and gives the Path a different behavior than the arguments (where the Path drops invalid characters and the arguments are simply dropped if they contain invalid characters).
I could also find the format! issue from the first bug in rootfs.rs.
All of the examples above operate on Paths with String as an intermediate data type. String is always UTF-8 compatible, but Path is not. This means that assert_eq!(Path::new(format!("{}{}", a.display(), b.display())), a.join(b)); will fail for some paths. I have not had time to find where these functions are used, so I don't know how big of an issue this is, but it should be fixed before it becomes a serious issue. It should also be verified that CStrings/OsStrings never use Strings as an intermediate data type.
The text was updated successfully, but these errors were encountered:
I've noticed multiple bugs regarding data types in utils.rs. Since they are of the same type, I made it a single ticket.
First bug appends two paths with the
format!
macro instead of usingPath::join
.Second bug is similar with a function which seems to try to perform
Path::strip_prefix("/")
.Third bug converts the executed program and its arguments to
String
, and gives thePath
a different behavior than the arguments (where thePath
drops invalid characters and the arguments are simply dropped if they contain invalid characters).I could also find the
format!
issue from the first bug in rootfs.rs.All of the examples above operate on
Path
s withString
as an intermediate data type. String is always UTF-8 compatible, but Path is not. This means thatassert_eq!(Path::new(format!("{}{}", a.display(), b.display())), a.join(b));
will fail for some paths. I have not had time to find where these functions are used, so I don't know how big of an issue this is, but it should be fixed before it becomes a serious issue. It should also be verified thatCString
s/OsString
s never useString
s as an intermediate data type.The text was updated successfully, but these errors were encountered: