public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7 4/4] EXYNOS: SMDK5250: Add MMC SPL support
Date: Wed, 8 Feb 2012 22:51:41 -0500	[thread overview]
Message-ID: <201202082251.44958.vapier@gentoo.org> (raw)
In-Reply-To: <CAD=FV=UWS3NuqQpZuqx5aK4sOwF6cTzwwN+FN_Tg2y3RtfELGg@mail.gmail.com>

On Wednesday 08 February 2012 18:35:28 Doug Anderson wrote:
> On Thu, Feb 2, 2012 at 1:21 PM, Mike Frysinger wrote:
> > On Thursday 02 February 2012 04:11:27 Chander Kashyap wrote:
> > > +int main(int argc, char **argv)
> > > +{
> > > ...
> > > +     unsigned char buffer[BUFSIZE] = {0};
> > 
> > this is an implicit memset() and from what i can see in the code,
> > useless. you read() the entire buffer, so there's no need to initialize
> > it.
> 
> Funny, I was just about to submit a patch to add this = {0} myself when I
> found this message.  ;)  I would say that it (or a memset, whichever people
> prefer) is a good idea so that this tool can be used to make a reasonable
> SPL out of any source binary executable, even ones that are smaller than
> 14K.

you're right ... i'll claim that i was deceived by the lack of input checking.  
sounds like the code should be aborting if the input is too large instead of 
silently truncating.  then the memset/{0} is unnecessary:
	- write out the data read
	- lseek to the checksum position
	- write checksum
	- ftruncate to total length (16KiB?)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120208/0bbc2222/attachment.pgp>

  reply	other threads:[~2012-02-09  3:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02  9:11 [U-Boot] [PATCH v7 0/4] Add SMDK5250 board support Chander Kashyap
2012-02-02  9:11 ` [U-Boot] [PATCH v7 1/4] Exynos: Clock.c: Use CONFIG_SYS_CLK_FREQ macro Chander Kashyap
2012-02-02  9:11 ` [U-Boot] [PATCH v7 2/4] ARM: EXYNOS: Add support for Exynos5 based SoCs Chander Kashyap
2012-02-02  9:11 ` [U-Boot] [PATCH v7 3/4] EXYNOS: Add SMDK5250 board support Chander Kashyap
2012-02-02  9:11 ` [U-Boot] [PATCH v7 4/4] EXYNOS: SMDK5250: Add MMC SPL support Chander Kashyap
2012-02-02 21:21   ` Mike Frysinger
2012-02-03 12:23     ` Chander Kashyap
2012-02-08 23:35     ` Doug Anderson
2012-02-09  3:51       ` Mike Frysinger [this message]
2012-02-09  5:25         ` [U-Boot] [Samsung] " Chander Kashyap
2012-02-09  5:34           ` Mike Frysinger

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=201202082251.44958.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox