]> granicus.if.org Git - php/commitdiff
fix hash_pbkdf2()
authorAnatol Belski <ab@php.net>
Thu, 28 Aug 2014 06:55:05 +0000 (08:55 +0200)
committerAnatol Belski <ab@php.net>
Thu, 28 Aug 2014 06:55:05 +0000 (08:55 +0200)
ext/hash/hash.c

index 95d1d659dd819bf006b4601598184b96e0f265ca..5a4529d0f565959ff60389eb75906649b3db1b7a 100644 (file)
@@ -603,9 +603,8 @@ PHP_FUNCTION(hash_pbkdf2)
        zend_string *returnval;
        char *algo, *salt, *pass = NULL;
        unsigned char *computed_salt, *digest, *temp, *result, *K1, *K2 = NULL;
-       zend_long loops, i, j, iterations, digest_length = 0;
-       size_t algo_len, pass_len, length = 0;
-       size_t salt_len = 0;
+       zend_long loops, i, j, iterations, digest_length = 0, length = 0;
+       size_t algo_len, pass_len, salt_len = 0;
        zend_bool raw_output = 0;
        const php_hash_ops *ops;
        void *context;
@@ -631,7 +630,7 @@ PHP_FUNCTION(hash_pbkdf2)
        }
 
        if (salt_len > INT_MAX - 4) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long, max of INT_MAX - 4 bytes: %d supplied", salt_len);
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long, max of INT_MAX - 4 bytes: %zd supplied", salt_len);
                RETURN_FALSE;
        }