File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ PHP NEWS
30
30
. Fixed bug #80861 (erronous array key overflow in 2D array with JIT).
31
31
(Dmitry)
32
32
33
+ - Pcntl:
34
+ . Fixed bug #79812 (Potential integer overflow in pcntl_exec()). (cmb)
35
+
33
36
- PDO_ODBC:
34
37
. Fixed bug #80783 (PDO ODBC truncates BLOB records at every 256th byte).
35
38
(cmb)
Original file line number Diff line number Diff line change @@ -785,7 +785,7 @@ PHP_FUNCTION(pcntl_exec)
785
785
int envc = 0 , envi = 0 ;
786
786
char * * argv = NULL , * * envp = NULL ;
787
787
char * * current_arg , * * pair ;
788
- int pair_length ;
788
+ size_t pair_length ;
789
789
zend_string * key ;
790
790
char * path ;
791
791
size_t path_len ;
@@ -845,8 +845,9 @@ PHP_FUNCTION(pcntl_exec)
845
845
}
846
846
847
847
/* Length of element + equal sign + length of key + null */
848
+ ZEND_ASSERT (Z_STRLEN_P (element ) < SIZE_MAX && ZSTR_LEN (key ) < SIZE_MAX );
849
+ * pair = safe_emalloc (Z_STRLEN_P (element ) + 1 , sizeof (char ), ZSTR_LEN (key ) + 1 );
848
850
pair_length = Z_STRLEN_P (element ) + ZSTR_LEN (key ) + 2 ;
849
- * pair = emalloc (pair_length );
850
851
strlcpy (* pair , ZSTR_VAL (key ), ZSTR_LEN (key ) + 1 );
851
852
strlcat (* pair , "=" , pair_length );
852
853
strlcat (* pair , Z_STRVAL_P (element ), pair_length );
You can’t perform that action at this time.
0 commit comments