Backup all the infomem before erasing the segment. Thanks to Frederik Hermans for reporting this.

This commit is contained in:
nvt-se 2009-07-21 16:56:33 +00:00
parent 31253a29a1
commit 34a6fc82a3

View File

@ -80,7 +80,7 @@ infomem_write(unsigned int offset, unsigned char count, ...)
return FALSE;
}
flash = (uint8_t *)INFOMEM_START + offset;
flash = (uint8_t *)INFOMEM_START;
s = splhigh();
@ -90,9 +90,9 @@ infomem_write(unsigned int offset, unsigned char count, ...)
/* merge backup with new data */
va_start(argp, count);
buffer = (uint8_t *)backup;
buffer = (uint8_t *)backup + offset;
for(i = 0; i < count; i++) {
data = va_arg(argp, uint8_t*);
data = va_arg(argp, uint8_t *);
size = va_arg(argp, uint16_t);
memcpy(buffer, data, size);
buffer += size;