Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misaligned pointer dereference in test append #4

Open
riking opened this issue Feb 28, 2024 · 0 comments
Open

misaligned pointer dereference in test append #4

riking opened this issue Feb 28, 2024 · 0 comments

Comments

@riking
Copy link

riking commented Feb 28, 2024

https://asan.saethlin.dev/ub?crate=tripcode&version=0.2.1

test tests::append ... thread 'tests::append' panicked at src/lib.rs:665:30:
misaligned pointer dereference: address must be a multiple of 0x8 but is 0x7f77ba3fce42
stack backtrace:
   0: rust_begin_unwind
             at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_nounwind_fmt
             at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:106:14
   2: core::panicking::panic_misaligned_pointer_dereference
             at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:203:5
   3: <tripcode::Sc15 as tripcode::TripcodeGenerator>::hash::{{closure}}
             at ./src/lib.rs:665:30
   4: tripcode::sha1_internal
             at ./src/lib.rs:580:5
   5: <tripcode::Sc15 as tripcode::TripcodeGenerator>::hash
             at ./src/lib.rs:656:9
   6: <tripcode::ScKatakana as tripcode::TripcodeGenerator>::hash
             at ./src/lib.rs:677:24
   7: tripcode::TripcodeGenerator::append
             at ./src/lib.rs:279:9
   8: tripcode::tests::append
             at ./src/lib.rs:829:9
   9: tripcode::tests::append::{{closure}}
             at ./src/lib.rs:820:16

You may want to consider the ring crate if you are looking for a SHA1 implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant