Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behaviour of Value::parseValue with odd vs even number of consecutive delimiters #622

Open
JakeQZ opened this issue Jun 27, 2024 · 2 comments
Labels
future investigation needed Further investigation is needed to determine the nature of the problem, or if it even is an issue. tbd testing PRs/issues adding additional tests only, or primarily testing-focused

Comments

@JakeQZ
Copy link
Contributor

JakeQZ commented Jun 27, 2024

Initial investigation arises from the infinite loop fix in #390, which it turns out was fixed separately by #413.

I tried throwing the following at Value::parseValue:

  • /!;
  • //!;
  • ///!;
  • ////!;

The 1st and 3rd seemed fine, resulting in /`` and ///respectively. The 2nd and 4th resulted inUnexpectedTokenException: Identifier expected. Got “!;”`.

In terms of the metaphor "low-hanging-fruit", this isn't even fruit. I am just logging this so the information is captured, and that we can be mindful of the curious behaviour when revisiting that area of the code.

@JakeQZ JakeQZ added future tbd testing PRs/issues adding additional tests only, or primarily testing-focused investigation needed Further investigation is needed to determine the nature of the problem, or if it even is an issue. labels Jun 27, 2024
@oliverklee
Copy link
Contributor

That's very strange (and unfruity) indeed …

@oliverklee
Copy link
Contributor

Nikita Popov also reported some strange behavior he encountered using fuzzing. We'll want to check those some time (preferably after the 9.0 release - I'd like to do some big cleanups for 10.0): https://github.com/MyIntervals/PHP-CSS-Parser/issues/created_by/nikic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future investigation needed Further investigation is needed to determine the nature of the problem, or if it even is an issue. tbd testing PRs/issues adding additional tests only, or primarily testing-focused
Projects
None yet
Development

No branches or pull requests

2 participants