Skip to content

Deprecation in YAML parser #54704

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

Closed
prudloff-insite opened this issue Apr 23, 2024 · 1 comment
Closed

Deprecation in YAML parser #54704

prudloff-insite opened this issue Apr 23, 2024 · 1 comment
Labels
Bug Good first issue Ideal for your first contribution! (some Symfony experience may be required) Status: Needs Review Yaml

Comments

@prudloff-insite
Copy link

Symfony version(s) affected

6.4.3

Description

We noticed that the YAML parser triggers a deprecation with some malformed strings:

   DEPRECATED  substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /var/www/vendor/symfony/yaml/Parser.php on line 641.

How to reproduce

  $yaml = new \Symfony\Component\Yaml\Parser();
  $yaml->parse(',:
-

');

Possible Solution

No response

Additional Context

We noticed this while testing our YAML parsing logic with php-fuzzer.

@xabbuh xabbuh added the Yaml label Apr 23, 2024
@GromNaN GromNaN added the Good first issue Ideal for your first contribution! (some Symfony experience may be required) label Apr 23, 2024
@xabbuh
Copy link
Member

xabbuh commented Apr 23, 2024

good catch, should be fixed with #54706

nicolas-grekas added a commit that referenced this issue Apr 23, 2024
This PR was merged into the 5.4 branch.

Discussion
----------

[Yaml] call substr() with integer offsets

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #54704
| License       | MIT

Commits
-------

f439702 call substr() with integer offsets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Good first issue Ideal for your first contribution! (some Symfony experience may be required) Status: Needs Review Yaml
Projects
None yet
Development

No branches or pull requests

5 participants