sabberworm / PHP-CSS-Parser

A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS

Home Page:http://www.sabberworm.com/blog/2010/6/10/php-css-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uninitialized string offset warning with unterminated color literal

nikic opened this issue · comments

Parsing the input a{f:#1 produces an uninitialized string offset warning:

Error: [2] Uninitialized string offset: 1 in /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Color.php on line 33 in /home/nikic/PHP-Fuzzer/src/Fuzzer.php:471
Stack trace:
#0 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Color.php(33): PhpFuzzer\Fuzzer->PhpFuzzer\{closure}(2, 'Uninitialized s...', '/home/nikic/PHP...', 33)
#1 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Value.php(84): Sabberworm\CSS\Value\Color::parse(Object(Sabberworm\CSS\Parsing\ParserState))
#2 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Value.php(36): Sabberworm\CSS\Value\Value::parsePrimitiveValue(Object(Sabberworm\CSS\Parsing\ParserState))
#3 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Rule/Rule.php(39): Sabberworm\CSS\Value\Value::parseValue(Object(Sabberworm\CSS\Parsing\ParserState), Array)
#4 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php(35): Sabberworm\CSS\Rule\Rule::parse(Object(Sabberworm\CSS\Parsing\ParserState))
#5 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php(62): Sabberworm\CSS\RuleSet\RuleSet::parseRuleSet(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\RuleSet\DeclarationBlock))
#6 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php(101): Sabberworm\CSS\RuleSet\DeclarationBlock::parse(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#7 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php(50): Sabberworm\CSS\CSSList\CSSList::parseListItem(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#8 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/Document.php(21): Sabberworm\CSS\CSSList\CSSList::parseList(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#9 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Parser.php(38): Sabberworm\CSS\CSSList\Document::parse(Object(Sabberworm\CSS\Parsing\ParserState))
#10 /home/nikic/PHP-Fuzzer/example/target_css_parser.php(9): Sabberworm\CSS\Parser->parse()
ezoic increase your site revenue