From 1c1bfb9c785f4f2ed6d2a0488bf981808e1fde0c Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sun, 21 Apr 2013 17:53:34 +0200 Subject: image: Fix buffer pointer in function image_hash_from_data --- src/image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/image.c b/src/image.c index f5b2bf6..44655fb 100644 --- a/src/image.c +++ b/src/image.c @@ -442,7 +442,7 @@ void image_list_unlink(struct image_list * list) { } -static uint16_t do_hash(uint16_t * b, int len) { +static uint16_t do_hash(uint16_t * b, size_t len) { uint16_t result = 0; @@ -457,11 +457,11 @@ uint16_t image_hash_from_data(struct image * image) { unsigned char buf[0x20000]; uint16_t hash = 0; - int ret; + size_t ret; image_seek(image, 0); - while ( ( ret = image_read(image, &buf, sizeof(buf)) ) ) - hash ^= do_hash((uint16_t *)&buf, ret); + while ( ( ret = image_read(image, buf, sizeof(buf)) ) ) + hash ^= do_hash((uint16_t *)buf, ret); return hash; } -- cgit v1.2.3