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

parser too strict on anchor names? [rt.cpan.org #80353] #127

Closed
ingydotnet opened this issue Aug 14, 2014 · 2 comments
Closed

parser too strict on anchor names? [rt.cpan.org #80353] #127

ingydotnet opened this issue Aug 14, 2014 · 2 comments

Comments

@ingydotnet
Copy link
Owner

https://rt.cpan.org/Ticket/Display.html?id=80353

Module ver: YAML-0.84
perl ver:   perl 5, version 14, subversion 2 (v5.14.2) built for cygwin-
thread-multi-64int
OS:         CYGWIN_NT-6.1-WOW64

In _parse_qualifiers, anchor tokens are required to be alphanum:

            $self->die('YAML_PARSE_ERR_BAD_ANCHOR')
              unless $token =~ /^[a-zA-Z0-9]+$/;

The YAML 1.2 spec has a much looser defn of anchor names:

ns-anchor-char  ::= ns-char - c-flow-indicator   
ns-anchor-name  ::= ns-anchor-char+

where ns-char is the (frighteningly huge, and probably not what they 
meant to do) set:
[#x21-#x7E] | #x85 | [#xA0-#xD7FF] | [#xE000-#xFEFE] | [#xFF00-#xFFFD] | 
[#x10000-#x10FFFF]

and c-flow-indicator is: “,” | “[” | “]” | “{” | “}”

My current failure case is an underscore in an anchor name, so /^\w+$/ 
would be sufficient for me, but it seems more investigation is needed 
here.
@perlpunk
Copy link
Collaborator

fixed in master by adding -_/. to the allowed characters (although that doesn't allow all characters that are specified)

@perlpunk
Copy link
Collaborator

perlpunk commented May 6, 2018

Released YAML 1.24_001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants