-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Rust): Fix memory errors caused by casting (#1372)
In the stable version of Rust, the `from_raw_parts_mut` API does not check for memory alignment, but in the 1.78.0-nightly version, alignment checking has been added to the preconditions. To ensure memory safety, we have replaced direct memory writes with the `LittleEndian::write_xx` methods from the appropriate library. While this may introduce additional overhead for memory checks, robustness is the priority before releasing the software.
- Loading branch information
1 parent
1d345bb
commit a6986ec
Showing
2 changed files
with
89 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters