[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in shell: buffer overflow.
From: |
Bob Proulx |
Subject: |
Re: Bug in shell: buffer overflow. |
Date: |
Sat, 1 Jan 2011 12:35:44 -0700 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Stephane CHAZELAS wrote:
> Bob Proulx wrote:
> [...]
> > 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.
Ah... I didn't know that. Thank you for that correction.
Unfortunately LONG_MAX is not available from getconf. But on my
system in limits.h LONG_MAX is defined as 9223372036854775807 and the
at least one of the previous example calculations was:
echo $((72057594037927936*128))
which according to bc works out to be:
9223372036854775808
Bob