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

List:       busybox
Subject:    Re: busybox awk int overflow bug
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2013-07-20 19:26:07
Message-ID: CAK1hOcOdzi5gdp=0Mnrm62skq04N753KXBM8SP+R7fyP_5a0Cw () mail ! gmail ! com
[Download RAW message or body]

On Fri, Jul 19, 2013 at 4:42 PM, John Spencer
<maillist-busybox@barfooze.de> wrote:
> this was reported on irc
>
> "BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}"
>
> $ gawk "BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}"
> 2147483647 2147483647 0 2147483648 2147483648 0
>
> $ busybox awk "BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}"
> 2147483647 2147483647 0 2.14748e+09 -2147483648 4.29497e+09
>
> at least the last 2 values returned are bogus, it looks as if the int
> truncation overflowed.

Fixed in git. Thanks
_______________________________________________
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