---

** [tickets:#103] Division by 0 in flash/nor/nrf51.c**

**Status:** new
**Milestone:** 0.9.0
**Created:** Thu Jul 30, 2015 03:19 PM UTC by Andrzej Telszewski
**Last Updated:** Thu Jul 30, 2015 03:19 PM UTC
**Owner:** nobody


Hi,

It's possible to get division by 0 and crash the application in 
flash/nor/nrf51.c.

On line 630 you read:
res = target_read_u32(chip->target, NRF51_FICR_CODEPAGESIZE, 
&chip->code_page_size);

And then on line 650 you divide:
bank->num_sectors = bank->size / chip->code_page_size;

It's possible for chip->code_page_size to be 0 and crash the application.

It happened to me.

--
Best regards,
Andrzej Telszewski


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to