From e13f4fb57277acf2b0edb902e66be8b22b08ede9 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Wed, 7 May 2025 15:42:52 +0100 Subject: [PATCH] fix pointer conversion --- hw/arm/ipod_touch_sha1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/ipod_touch_sha1.c b/hw/arm/ipod_touch_sha1.c index 09e8d6e0dc0bd..6c07bbdf887a9 100644 --- a/hw/arm/ipod_touch_sha1.c +++ b/hw/arm/ipod_touch_sha1.c @@ -52,7 +52,9 @@ static uint64_t s5l8900_sha1_read(void *opaque, hwaddr offset, unsigned size) //fprintf(stderr, "Hash out %08x\n", *(uint32_t *)&s->hashout[offset - 0x20]); if(!s->hash_computed) { // lazy compute the final hash by inspecting the last eight bytes of the buffer, which contains the length of the input data. - uint64_t data_length = swapLong(((uint64_t *)s->buffer)[s->buffer_ind / 8 - 1]) / 8; + uint64_t val = ((uint64_t *)s->buffer)[s->buffer_ind / 8 - 1]; + uint64_t data_length = swapLong(&val) / 8; + SHA_CTX ctx; SHA1_Init(&ctx);