Andrew,
Seems the netfilter guys found a major problem with strtoul(). Thankfully the same fix should work for us as well.


Luciano Coelho wrote:
<snip>
>
> Not easily.  I found that there is a bug in strtoul (and strtoull for
> that matter) that causes the long to overflow if there are valid digits
> after the maximum possible digits for the base.  For example if you try
> to strtoul 0xfffffffff (with 9 f's) the strtoul will overflow and come
> up with a bogus result.  I can't easily truncate the string to avoid
> this problem, because with decimal or octal, the same valid value would
> take more spaces.  I could do some magic here, checking whether it's a
> hex, dec or oct and truncate appropriately, but that would be very ugly.
>
> So the simplest way I came up with was to use strtoull and return
> -EINVAL if the value exceeds 32 bits. ;)
>



Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.6
  Beta testers wanted for 3.2.0.1

Reply via email to