1
0
Fork 0
forked from len0rd/rockbox

sbtools: fix buffer overflow

Change-Id: I7b1c963e58eec88da215722ec219569a0a5a9cea
This commit is contained in:
Amaury Pouly 2013-08-22 00:49:34 +02:00
parent 05bd3e4cd2
commit e64008bf9a

View file

@ -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++)