Skip to content

Commit

Permalink
Fix unititialized string offset access in query parser
Browse files Browse the repository at this point in the history
The code always tried to access positon 2 of the parsed token, even for
tokens shorter than that (like OR)

fixes #3896
  • Loading branch information
splitbrain committed Feb 25, 2023
1 parent a42c05d commit 40f2b82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions _test/tests/inc/changelog_getrevisions.test.php
Expand Up @@ -228,4 +228,5 @@ function test_requesttoolargenumberrevs() {
$this->assertEquals($revsexpected, $revs);
}


}
2 changes: 1 addition & 1 deletion inc/fulltext.php
Expand Up @@ -845,7 +845,7 @@ function ft_queryParser($Indexer, $query){
$q['parsed_ary'] = $parsed_ary;

foreach ($q['parsed_ary'] as $token) {
if ($token[2] !== ':') continue;
if (strlen($token) < 3 || $token[2] !== ':') continue;
$body = substr($token, 3);

switch (substr($token, 0, 3)) {
Expand Down

0 comments on commit 40f2b82

Please sign in to comment.