[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [OpenOCD-devel] [openocd:tickets] #103 Division by 0 in flash/nor/nrf51.c
From:       "Andrzej Telszewski" <atelszewski () users ! sf ! net>
Date:       2015-07-30 15:19:32
Message-ID: 55ba4082c4d104774ea7ba6e.tickets () openocd ! p ! sourceforge ! net
[Download RAW message or body]

[Attachment #2 (multipart/related)]


--===============1185856078112146290==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit




---

** [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 openocd-devel@lists.sourceforge.net 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.
--===============1185856078112146290==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><hr />
<p><strong> <a class="alink" \
href="http://sourceforge.net/p/openocd/tickets/103">[tickets:#103]</a> Division by 0 \
in flash/nor/nrf51.c</strong></p> <p><strong>Status:</strong> new<br />
<strong>Milestone:</strong> 0.9.0<br />
<strong>Created:</strong> Thu Jul 30, 2015 03:19 PM UTC by Andrzej Telszewski<br />
<strong>Last Updated:</strong> Thu Jul 30, 2015 03:19 PM UTC<br />
<strong>Owner:</strong> nobody</p>
<p>Hi,</p>
<p>It's possible to get division by 0 and crash the application in \
flash/nor/nrf51.c.</p> <p>On line 630 you read:<br />
res = target_read_u32(chip-&gt;target, NRF51_FICR_CODEPAGESIZE, \
&amp;chip-&gt;code_page_size);</p> <p>And then on line 650 you divide:<br />
bank-&gt;num_sectors = bank-&gt;size / chip-&gt;code_page_size;</p>
<p>It's possible for chip-&gt;code_page_size to be 0 and crash the application.</p>
<p>It happened to me.</p>
<p>--<br />
Best regards,<br />
Andrzej Telszewski</p>
<hr />
<p>Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is \
subscribed to <a href="https://sourceforge.net/p/openocd/tickets">https://sourceforge.net/p/openocd/tickets/</a></p>
 <p>To unsubscribe from further messages, a project admin can change settings at <a \
href="https://sourceforge.net/p/openocd/admin/tickets/options.">https://sourceforge.net/p/openocd/admin/tickets/options.</a> \
                Or, if this is a mailing list, you can unsubscribe from the mailing \
                list.</p></div>
--===============1185856078112146290==--



------------------------------------------------------------------------------


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic