Although the library may no longer be maintained and will not compile in my current environment, I intend to report the issue for reference only.
Description
|
pub fn as_slice(&self) -> &[Variable] { |
|
pub fn as_slice_mut(&mut self) -> &mut [Variable] { |
consider the two functions above, they use unsafe API
from_raw_parts and
from_raw_parts_mut, however, the Environment is a pub struct which means the user can directly manipulate its values_ptr and values_count fields, which are also pub, and pass directly into the unsafe API, so I believe there is a health issue here.
Although the library may no longer be maintained and will not compile in my current environment, I intend to report the issue for reference only.
Description
starlight/crates/starlight/src/vm/environment.rs
Line 43 in 503e789
starlight/crates/starlight/src/vm/environment.rs
Line 47 in 503e789
consider the two functions above, they use unsafe API
from_raw_partsandfrom_raw_parts_mut, however, the Environment is a pub struct which means the user can directly manipulate its values_ptr and values_count fields, which are also pub, and pass directly into the unsafe API, so I believe there is a health issue here.