rasmus                                   Sun, 07 Aug 2011 00:36:26 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=314390

Log:
I'm pretty sure you didn't mean to multiple by the size of a char* there
since that makes no sense. output is an array of char, not an array of
char*
Pierre, please review

Changed paths:
    U   php/php-src/branches/PHP_5_4/ext/standard/crypt.c
    U   php/php-src/trunk/ext/standard/crypt.c

Modified: php/php-src/branches/PHP_5_4/ext/standard/crypt.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/crypt.c   2011-08-07 00:25:22 UTC 
(rev 314389)
+++ php/php-src/branches/PHP_5_4/ext/standard/crypt.c   2011-08-07 00:36:26 UTC 
(rev 314390)
@@ -200,7 +200,7 @@
                        int needed = (sizeof(sha512_salt_prefix) - 1
                                                + sizeof(sha512_rounds_prefix) 
+ 9 + 1
                                                + strlen(salt) + 1 + 43 + 1);
-                       output = emalloc(needed * sizeof(char *));
+                       output = emalloc(needed);
                        salt[salt_in_len] = '\0';

                        crypt_res = php_sha512_crypt_r(str, salt, output, 
needed);
@@ -223,7 +223,7 @@
                        int needed = (sizeof(sha256_salt_prefix) - 1
                                                + sizeof(sha256_rounds_prefix) 
+ 9 + 1
                                                + strlen(salt) + 1 + 43 + 1);
-                       output = emalloc(needed * sizeof(char *));
+                       output = emalloc(needed);
                        salt[salt_in_len] = '\0';

                        crypt_res = php_sha256_crypt_r(str, salt, output, 
needed);

Modified: php/php-src/trunk/ext/standard/crypt.c
===================================================================
--- php/php-src/trunk/ext/standard/crypt.c      2011-08-07 00:25:22 UTC (rev 
314389)
+++ php/php-src/trunk/ext/standard/crypt.c      2011-08-07 00:36:26 UTC (rev 
314390)
@@ -198,7 +198,7 @@
                        int needed = (sizeof(sha512_salt_prefix) - 1
                                                + sizeof(sha512_rounds_prefix) 
+ 9 + 1
                                                + strlen(salt) + 1 + 43 + 1);
-                       output = emalloc(needed * sizeof(char *));
+                       output = emalloc(needed);
                        salt[salt_in_len] = '\0';

                        crypt_res = php_sha512_crypt_r(str, salt, output, 
needed);
@@ -221,7 +221,7 @@
                        int needed = (sizeof(sha256_salt_prefix) - 1
                                                + sizeof(sha256_rounds_prefix) 
+ 9 + 1
                                                + strlen(salt) + 1 + 43 + 1);
-                       output = emalloc(needed * sizeof(char *));
+                       output = emalloc(needed);
                        salt[salt_in_len] = '\0';

                        crypt_res = php_sha256_crypt_r(str, salt, output, 
needed);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to