Re: cvs: php-src(PHP_5_2) /ext/standard basic_functions.c /ext/standard/tests/network ip.phpt
| From: | Antony Dovgal | Date: | Thu, 16 Aug 2007 22:34:35 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_2) /ext/standard basic_functions.c /ext/standard/tests/network ip.phpt | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-45908@lists.php.net to get a copy of this message | ||
On 17.08.2007 02:17, Jani Taskinen wrote:
- if (!memcmp(Z_STRVAL_PP(str), "255.255.255.255", Z_STRLEN_PP(str))) { + if (!memcmp(Z_STRVAL_PP(str), "255.255.255.255", sizeof("255.255.255.255") - 1)) { RETURN_LONG(-1); }Are you sure it is correct to compare first 15 bytes of _empty string_ with "255.255.255.255"? I'd say it should look like this: if (Z_STRLEN_PP(str) == (sizeof("255.255.255.255") - 1) && !memcmp(Z_STRVAL_PP(str), "255.255.255.255", Z_STRLEN_PP(str))) { -- Wbr, Antony Dovgal