1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 09:42:22 +01:00

Escape value passed to exec()

getmypid() is safe, but no harm being EXTRA safe.
This commit is contained in:
Sara Golemon
2017-06-01 15:42:17 -07:00
parent a9294d36bc
commit a86c87df2d

View File

@@ -13,7 +13,7 @@ if ($status !== 0) {
--FILE--
<?php
function countOpenFiles() {
exec('lsof -p ' . getmypid() . ' 2> /dev/null', $out);
exec('lsof -p ' . escapeshellarg(getmypid()) . ' 2> /dev/null', $out);
return count($out);
}
$filename = __DIR__ . '/bug70417.tar';