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

List:       busybox
Subject:    Re: [PATCH] obscure code patch
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-08-17 14:05:41
Message-ID: AANLkTimpz+EEyoEU9p34VGJydzEA9phMC7ELN4nJ0dn6 () mail ! gmail ! com
[Download RAW message or body]

On Tue, Aug 17, 2010 at 1:44 PM, Bob Dunlop <bob.dunlop@xyzzy.org.uk> wrote:
> Sorry couldn't resist setting that as a subject.
>
> Anyway in obscure_msg() in libbb/obscure.c  we have a few lines of code
> that read:
>
>      if (!++p) {
>              break; /* move past the matched char if possible */
>      }
>
> Now since p is a pointer the condition !++p is only going to be true in the
> rare case of the pointer wrapping around the top of memory.  I think the
> original author probably intended !*++p for this conditon.

Good catch.

Actually, obscure.c does need more love. Applied your suggestion and more:

http://git.busybox.net/busybox/commit/?id=d71c770f05079e65b2d27d28ce22b0f08e71a207

Thanks!
-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

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

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