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
14
14
Stas)
15
15
. Fixed bug #62432 (ReflectionMethod random corrupt memory on high
16
16
concurrent). (Johannes)
17
+ . Fixed bug #62443 (Crypt SHA256/512 Segfaults With Malformed
18
+ Salt). (Anthony Ferrara)
17
19
18
20
- Fileinfo:
19
21
. Fixed magic file regex support. (Felipe)
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ PHP_FUNCTION(crypt)
199
199
char * output ;
200
200
int needed = (sizeof (sha512_salt_prefix ) - 1
201
201
+ sizeof (sha512_rounds_prefix ) + 9 + 1
202
- + strlen ( salt ) + 1 + 43 + 1 );
202
+ + PHP_MAX_SALT_LEN + 1 + 43 + 1 );
203
203
output = emalloc (needed * sizeof (char * ));
204
204
salt [salt_in_len ] = '\0' ;
205
205
@@ -222,7 +222,7 @@ PHP_FUNCTION(crypt)
222
222
char * output ;
223
223
int needed = (sizeof (sha256_salt_prefix ) - 1
224
224
+ sizeof (sha256_rounds_prefix ) + 9 + 1
225
- + strlen ( salt ) + 1 + 43 + 1 );
225
+ + PHP_MAX_SALT_LEN + 1 + 43 + 1 );
226
226
output = emalloc (needed * sizeof (char * ));
227
227
salt [salt_in_len ] = '\0' ;
228
228
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