fobos_fwloader -w fobos_usb_rx.img segfaults because of an erroneous calculation of a buffer size in fobos/fobos.c.
Here's the fix. I'm not submitting this as a PR because it's really trivial, and I already have a bigger PR pending to the same file (fobos.c) to implement raw mode.
in fobos_rx_write_firmware():
result = FOBOS_ERR_OK;
uint16_t xx_size = 1024;
- uint16_t xx_count = (uint16_t)(file_size + xx_size - 1)/ xx_size;
- uint16_t xx_count = (uint16_t)((file_size + xx_size - 1)/ xx_size);
uint8_t * file_data = (uint8_t * )malloc(xx_count * xx_size);
fseek(f, 0, SEEK_SET);
fobos_fwloader -w fobos_usb_rx.img segfaults because of an erroneous calculation of a buffer size in fobos/fobos.c.
Here's the fix. I'm not submitting this as a PR because it's really trivial, and I already have a bigger PR pending to the same file (fobos.c) to implement raw mode.
in fobos_rx_write_firmware():
uint8_t * file_data = (uint8_t * )malloc(xx_count * xx_size);
fseek(f, 0, SEEK_SET);