File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ PHP NEWS
1414 Stas)
1515 . Fixed bug #62432 (ReflectionMethod random corrupt memory on high
1616 concurrent). (Johannes)
17+ . Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
18+ Salt). (Anthony Ferrara)
1719
1820- Fileinfo:
1921 . Fixed magic file regex support. (Felipe)
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ PHP_FUNCTION(crypt)
199199 char * output ;
200200 int needed = (sizeof (sha512_salt_prefix ) - 1
201201 + sizeof (sha512_rounds_prefix ) + 9 + 1
202- + strlen ( salt ) + 1 + 43 + 1 );
202+ + PHP_MAX_SALT_LEN + 1 + 43 + 1 );
203203 output = emalloc (needed * sizeof (char * ));
204204 salt [salt_in_len ] = '\0' ;
205205
@@ -222,7 +222,7 @@ PHP_FUNCTION(crypt)
222222 char * output ;
223223 int needed = (sizeof (sha256_salt_prefix ) - 1
224224 + sizeof (sha256_rounds_prefix ) + 9 + 1
225- + strlen ( salt ) + 1 + 43 + 1 );
225+ + PHP_MAX_SALT_LEN + 1 + 43 + 1 );
226226 output = emalloc (needed * sizeof (char * ));
227227 salt [salt_in_len ] = '\0' ;
228228
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Bug #62443 Crypt SHA256/512 Segfaults With Malformed Salt
3+ --FILE--
4+ <?php
5+ crypt ("foo " , '$5$ ' .chr (0 ).'abc ' );
6+ crypt ("foo " , '$6$ ' .chr (0 ).'abc ' );
7+ echo "OK! " ;
8+ --EXPECT --
9+ OK !
You can’t perform that action at this time.
0 commit comments