com php-src: Escape value passed to exec(): ext/phar/tests/tar/bug70417.phpt
| From: | Sara Golemon | Date: | Thu, 01 Jun 2017 22:43:25 +0000 |
| Subject: | com php-src: Escape value passed to exec(): ext/phar/tests/tar/bug70417.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97980@lists.php.net to get a copy of this message | ||
Commit: a86c87df2dc2d3bf82bd87cddd888f899306a451
Author: Sara Golemon <pollita@php.net> Thu, 1 Jun 2017 15:42:17 -0700
Parents: a9294d36bce0b54458c95eaec89c17177b89e6ea
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a86c87df2dc2d3bf82bd87cddd888f899306a451
Log:
Escape value passed to exec()
getmypid() is safe, but no harm being EXTRA safe.
Changed paths:
M ext/phar/tests/tar/bug70417.phpt
Diff:
diff --git a/ext/phar/tests/tar/bug70417.phpt b/ext/phar/tests/tar/bug70417.phpt
index 9d30aae..0202ca9 100644
--- a/ext/phar/tests/tar/bug70417.phpt
+++ b/ext/phar/tests/tar/bug70417.phpt
@@ -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';