We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3072b77 commit 14fcc81Copy full SHA for 14fcc81
ext/standard/exec.c
@@ -531,6 +531,15 @@ PHP_FUNCTION(shell_exec)
531
Z_PARAM_STRING(command, command_len)
532
ZEND_PARSE_PARAMETERS_END();
533
534
+ if (!command_len) {
535
+ php_error_docref(NULL, E_WARNING, "Cannot execute a blank command");
536
+ RETURN_FALSE;
537
+ }
538
+ if (strlen(command) != command_len) {
539
+ php_error_docref(NULL, E_WARNING, "NULL byte detected. Possible attack");
540
541
542
+
543
#ifdef PHP_WIN32
544
if ((in=VCWD_POPEN(command, "rt"))==NULL) {
545
#else
0 commit comments