Re: [PHP-CVS] com php-src: fix (signed) integer overflow (part of bug #52550: Zend/zend_hash.h

2012-07-02 Thread Stas Malyshev
Hi! Could you please explain this commit? idx is ulong, why this change improves anything? Commit:91ce8041a3e85594e81466a528f8d55cdc164c1f Author:Nuno Lopes nlop...@php.net Mon, 2 Jul 2012 01:31:40 -0400 Parents: be4053cea0462c9de5396641f4e4fa2f56f5a675 Branches: PHP-5.4

Re: [PHP-CVS] com php-src: fix (signed) integer overflow (part of bug #52550: Zend/zend_hash.h

2012-07-02 Thread Nuno Lopes
In that code path, it's possible that idx == LONG_MAX+1. Casting that value to a signed long is undefined behavior (since it overflows), which means that the compiler can do bad things with that. With this patch we will basically do the same operation, but over an unsigned long, thus avoiding