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

resolving long integers (decimal, hexadecimal, octal) #435

Open
AvdN opened this issue Feb 8, 2019 · 1 comment
Open

resolving long integers (decimal, hexadecimal, octal) #435

AvdN opened this issue Feb 8, 2019 · 1 comment

Comments

@AvdN
Copy link

AvdN commented Feb 8, 2019

There is no restriction on size of integers in the YAML specification. However resolving integers in resolve.go assumes that something like 0xDef9C64256DeE61ebf5B212238df11C7E532e3B7 is a string because parseInt fails to parse this.

Although during loading it might be acceptable to load such a value as a string, during dumping (marshalling) this leads to output errors as I noticed when trying to answer https://stackoverflow.com/q/54584832/1307905, in which the above string doesn't get quoted, although it should be.

I assume that parseInt returns with err.Err = ErrRange (resolve.go line 151), but I don't see a way to return quoting style information by the resolve function.

@felixfontein
Copy link

getsops/sops#1003 is caused basically by this: a string containing a hex number, like "0x0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", is converted to 0x0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF when de- and then reserialized with go-yaml, which is then parsed as an integer by conforming YAML parsers.

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

No branches or pull requests

2 participants