From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd_mtdparts.c: prevent printbuffer overflows
Date: Tue, 23 Feb 2010 15:55:57 +0100 [thread overview]
Message-ID: <20100223155557.232246cc@wker> (raw)
In-Reply-To: <20100223142546.57DE2EB3810@gemini.denx.de>
Hello Wolfgang,
Wolfgang Denk <wd@denx.de> wrote:
> > + /* Check to prevent printbuffer overflows */
> > + if (mtdparts_default && strlen(mtdparts_default) > CONFIG_SYS_PBSIZE) {
> > + puts("Warning: mtdparts too long,"
> > + " please increase CONFIG_SYS_PBSIZE\n");
> > + return;
> > + }
> > +
>
> Instead of adding essentially dead code that does not really help the
> end user, it would be better to avoid the potential problems. As log
> as the console code has not been improved, it may make sense to avoid
> printf() when you don't really need it.
This is indeed much better, thanks!
> I recommend to change this
>
> > printf("mtdparts: %s\n",
> > mtdparts_default ? mtdparts_default : "none");
>
> into something like
>
> puts("mtdparts: ");
> puts(mtdparts_default ? mtdparts_default : "none");
I'll fix it as suggested, thanks!
Best regards,
Anatolij
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
prev parent reply other threads:[~2010-02-23 14:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 11:22 [U-Boot] [PATCH] cmd_mtdparts.c: prevent printbuffer overflows Anatolij Gustschin
2010-02-23 11:39 ` Detlev Zundel
2010-02-23 14:28 ` Wolfgang Denk
2010-02-23 14:25 ` Wolfgang Denk
2010-02-23 14:55 ` Anatolij Gustschin [this message]
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=20100223155557.232246cc@wker \
--to=agust@denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox