Skip to content

Fix misaligned pointer dereference error.

Wiktor Kwapisiewicz requested to merge aligned into main
  • Recently the Rust compiler started testing for memory alignment of raw pointers in debug mode (see #54915 and #98112) which panics even on platforms which allow unaligned reads (eg. x86 and amd64).

  • Note that evaluating a dereference expression (*expr) on a raw pointer that is unaligned, even in place expression context is considered undefined behavior.

  • Adjust the code to always align the memory in the sha1_process_unaligned function before processing it further.

  • Adjust documentation in to suggest the same.

  • Fixes #7 (closed)

Edited by Wiktor Kwapisiewicz

Merge request reports