bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in shell: buffer overflow.


From: Dennis Williamson
Subject: Re: Bug in shell: buffer overflow.
Date: Sat, 1 Jan 2011 13:48:10 -0600

On my 32-bit system in Bash:

$ printf '%u\n' -1
18446744073709551615
$ echo $((2**63-1))
9223372036854775807
$ echo $((2**63))
-9223372036854775808

On Sat, Jan 1, 2011 at 11:48 AM, Stephane CHAZELAS
<stephane_chazelas@yahoo.fr> wrote:
> 2010-12-31, 11:33(-07), Bob Proulx:
> [...]
>> Your expressions above are overflowing the value of your system's
>> maximum integer size.  You can read the system's maximum integer size
>> using getconf.
>>
>>   $ getconf INT_MAX
>>   2147483647
> [...]
>
> POSIX requires that arithmetic expansion be using at least
> signed longs, so getconf INT_MAX wouldn't necessarily be
> correct.
>
> --
> Stephane
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]