Skip to content

Commit ffa720d

Browse files
author
Marc Delisle
committed
Prevent null-byte injection in preg_replace()
1 parent dedd542 commit ffa720d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: libraries/Tracker.class.php

+3
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,9 @@ static public function handleQuery($query)
877877
if (empty($dbname)) {
878878
return;
879879
}
880+
// Remove null bytes (preg_replace() is vulnerable in some
881+
// PHP versions)
882+
$dbname = str_replace("\0", "", $dbname);
880883

881884
// If we found a valid statement
882885
if (isset($result['identifier'])) {

0 commit comments

Comments
 (0)