[PATCH] obscure code patch
Denys Vlasenko
vda.linux at googlemail.com
Tue Aug 17 14:05:41 UTC 2010
On Tue, Aug 17, 2010 at 1:44 PM, Bob Dunlop <bob.dunlop at 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
More information about the busybox
mailing list