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 V2] memcpy/memmove: Do not copy to same address
Date: Mon, 23 May 2011 23:47:01 -0400	[thread overview]
Message-ID: <201105232347.02781.vapier@gentoo.org> (raw)
In-Reply-To: <4DDAE1F9.70008@ahsoftware.de>

On Monday, May 23, 2011 18:38:49 Alexander Holler wrote:
> Am 24.05.2011 00:22, schrieb Wolfgang Denk:
> > Alexander Holler wrote:
> >> So you I will look forward to checks for NULL pointers and similiar in
> >> all C standard functions implemented in u-boot to circumvent tons of
> >> possible real world bugs in all callers of strcpy, strlen, mem* and
> >> whatever.
> > 
> > If you think a bit about this, you may find it more difficult than you
> > expect.  Keep in mind that on most systems supported by U-Boot code
> > like
> > 
> > 	int *p = (int *)0;
> > 	
> > 	print("*p = %d\n", *p);
> > 
> > is perfectly legal and supposed to work without any problems -
> > because 0 is a legal address, and it makes perfect senze that commands
> > like "md" or "cp" can be used to access it.  In the result, strcpy(),
> > strlen(), mem*() and whatever must beable to work on address 0 likeon
> > any other address, too.
> 
> I've never seen a valid use of strcpy() with a null-pointer in real
> world programs, which we are talking about, except in bugs.

i'm lazy and type "0" all the time for loading files, copying memory, 
displaying things, etc... in u-boot.  i dont feel like retraining my finger 
muscle memory if i dont have to ;).
-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/20110523/8f2a1b98/attachment.pgp 

  reply	other threads:[~2011-05-24  3:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12  6:58 [U-Boot] [PATCH] Do not copy to same address Matthias Weisser
2011-04-12  7:05 ` Mike Frysinger
2011-04-12  7:16   ` Matthias Weißer
2011-04-12  7:06 ` Albert ARIBAUD
2011-04-12  7:13   ` Matthias Weißer
2011-04-12  7:27     ` Albert ARIBAUD
2011-04-12  7:49       ` Matthias Weißer
2011-04-14  6:28         ` Albert ARIBAUD
2011-05-23  9:03 ` [U-Boot] [PATCH V2] memcpy/memmove: " Matthias Weisser
2011-05-23 21:07   ` Alexander Holler
2011-05-23 21:55     ` Wolfgang Denk
2011-05-23 22:12       ` Alexander Holler
2011-05-23 22:22         ` Wolfgang Denk
2011-05-23 22:38           ` Alexander Holler
2011-05-24  3:47             ` Mike Frysinger [this message]
2011-05-24 13:03               ` Alexander Holler
2011-05-24 19:37           ` Scott Wood
2011-05-24 20:39             ` Wolfgang Denk
2011-06-14  6:18   ` Matthias Weißer
2011-06-16 16:04     ` Matthias Weisser
2011-06-30  6:31     ` Matthias Weißer
2011-07-25 22:28   ` Wolfgang Denk

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=201105232347.02781.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