Rust introduced a change to std::slice::from_raw_parts() that breaks this crate. The panics caused by this change occur when parsing properties with the most prevalent being those of type TDH_INTYPE_UNICODESTRING in my testing.
To resolve this issue, this MR adds checks to validate the assertions made in std::slice::from_raw_parts() . These are:
the pointer must not be NULL
the pointer must be aligned
the total size of the slice not to exceed isize::MAX
I focused on resolving the wide string conversion, but I also added a proposed fixed for arrays though I was unable to validate it.
Rust introduced a change to
std::slice::from_raw_parts()
that breaks this crate. The panics caused by this change occur when parsing properties with the most prevalent being those of typeTDH_INTYPE_UNICODESTRING
in my testing.To resolve this issue, this MR adds checks to validate the assertions made in
std::slice::from_raw_parts()
. These are:isize::MAX
I focused on resolving the wide string conversion, but I also added a proposed fixed for arrays though I was unable to validate it.
Reference: