Re: Re: com php-src: Fix possible overflow in openssl_pbkdf2: ext/openssl/openssl.c
| From: | Matt Wilmas | Date: | Tue, 18 Aug 2015 22:40:12 +0000 |
| Subject: | Re: Re: com php-src: Fix possible overflow in openssl_pbkdf2: ext/openssl/openssl.c | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.cvs php.internals |
| Request: | Send a blank email to internals+get-87785@lists.php.net to get a copy of this message | ||
Hi Anatol,
----- Original Message -----
From: "Anatol Belski"
Sent: Tuesday, August 18, 2015
Ok, got the idea now. But sizeof(size_t) is always > sizeof(zend_long). And for signed, still it is simpler and safer to just use an #ifdef around.No, == like I said. :-) OK, just saw your correction (max instead of sizeof); but we're never comparing a size_t with zend_long, so it doesn't matter. I don't know where you're getting zend_long from anyway. [U]INT_MAX is an int, not zend_long... The check in the macro, that the compiler can remove, should be fine in all cases (even if *int* was 64-bit). I don't see how it's simpler or safer to use #if. But actually, if #if was used, should really be checking SIZE_MAX > UINT_MAX I guess, and ZEND_LONG_MAX > INT_MAX. But using sizeof() in the macro definition gives the same result... - Matt