diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-08-22 00:49:34 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-08-22 00:49:34 +0200 |
commit | e64008bf9ab62074beabb1d061ab228b7bf5d0b5 (patch) | |
tree | 4569e931bdd86c2ede34973bdd281a20817065c6 /utils/imxtools/sbtools/sb1.c | |
parent | 05bd3e4cd23da3b7dc67374c940e43d285b2e03e (diff) | |
download | rockbox-e64008bf9ab62074beabb1d061ab228b7bf5d0b5.tar.gz rockbox-e64008bf9ab62074beabb1d061ab228b7bf5d0b5.zip |
sbtools: fix buffer overflow
Change-Id: I7b1c963e58eec88da215722ec219569a0a5a9cea
Diffstat (limited to 'utils/imxtools/sbtools/sb1.c')
-rw-r--r-- | utils/imxtools/sbtools/sb1.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
159 | memmove(buf + i * SECTOR_SIZE, buf + i * (SECTOR_SIZE - 4), SECTOR_SIZE - 4); | 159 | memmove(buf + i * SECTOR_SIZE, buf + i * (SECTOR_SIZE - 4), SECTOR_SIZE - 4); |
160 | 160 | ||
161 | union xorcrypt_key_t key[2]; | 161 | union xorcrypt_key_t key[2]; |
162 | memcpy(key, sb->key.u.xor_key, sizeof(sb->key)); | 162 | memcpy(key, sb->key.u.xor_key, sizeof(sb->key.u.xor_key)); |
163 | void *ptr = header + 1; | 163 | void *ptr = header + 1; |
164 | int offset = header->header_size; | 164 | int offset = header->header_size; |
165 | for(unsigned i = 0; i < image_size / SECTOR_SIZE; i++) | 165 | for(unsigned i = 0; i < image_size / SECTOR_SIZE; i++) |