Skip to content

Commit

Permalink
Prevent null-byte injection in preg_replace()
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed Apr 24, 2013
1 parent dedd542 commit ffa720d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libraries/Tracker.class.php
Expand Up @@ -877,6 +877,9 @@ static public function handleQuery($query)
if (empty($dbname)) {
return;
}
// Remove null bytes (preg_replace() is vulnerable in some
// PHP versions)
$dbname = str_replace("\0", "", $dbname);

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

0 comments on commit ffa720d

Please sign in to comment.