From e64008bf9ab62074beabb1d061ab228b7bf5d0b5 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 22 Aug 2013 00:49:34 +0200 Subject: sbtools: fix buffer overflow Change-Id: I7b1c963e58eec88da215722ec219569a0a5a9cea --- utils/imxtools/sbtools/sb1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/imxtools/sbtools/sb1.c') diff --git a/utils/imxtools/sbtools/sb1.c b/utils/imxtools/sbtools/sb1.c index ed5893f454..06e29c4ecb 100644 --- a/utils/imxtools/sbtools/sb1.c +++ b/utils/imxtools/sbtools/sb1.c @@ -159,7 +159,7 @@ enum sb1_error_t sb1_write_file(struct sb1_file_t *sb, const char *filename) memmove(buf + i * SECTOR_SIZE, buf + i * (SECTOR_SIZE - 4), SECTOR_SIZE - 4); union xorcrypt_key_t key[2]; - memcpy(key, sb->key.u.xor_key, sizeof(sb->key)); + memcpy(key, sb->key.u.xor_key, sizeof(sb->key.u.xor_key)); void *ptr = header + 1; int offset = header->header_size; for(unsigned i = 0; i < image_size / SECTOR_SIZE; i++) -- cgit v1.2.3