All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: Out of bounds access in arch/arm/cpu/armv7/iproc-common/armpll.c
Date: Sun, 7 Jun 2020 00:51:01 +0200	[thread overview]
Message-ID: <4d0c4259-39a4-5805-2ed8-112daefc241b@gmx.de> (raw)

Hello Scott,

CppCheck gives an error:

[arch/arm/cpu/armv7/iproc-common/armpll.c:137]: (error) Array
'armpll_clk_tab[13]' accessed at index 17, which is out of bounds.

In the loop at the start of armpll_config() i is determined. The maximum
value of i after checking status in line 53 is 12.

In line 137 your code accesses

armpll_clk_tab[i+4].freqid

The patch where you introduced the code dates from 2014. But hopefully
you still remember what you intended to do in that line.

Best regards

Heinrich

             reply	other threads:[~2020-06-06 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06 22:51 Heinrich Schuchardt [this message]
2020-06-22 19:03 ` Out of bounds access in arch/arm/cpu/armv7/iproc-common/armpll.c Scott Branden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d0c4259-39a4-5805-2ed8-112daefc241b@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.