encoding/xml: copyValue uses int16 causing error on strconv.ParseInt #32041
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Unmarshalled an XML node containing the int value 258387
What did you expect to see?
The string "258387" parsed correctly to it's integer value.
What did you see instead?
When parsing an XML attribute, the xml.Unmarshal method uses a signed 16b int for the destination of ParseInt.
When the parsed integer is > MAX_16 an (expected for the size of dst) error is thrown.
Not sure if this is reproducible every time an int is parsed > MAX_16, rather in my large (40MB) XML file, this is a consistent occurrence with every int.
in xml/read.go:
the value presented by the debugger during runtime:
call stack:
The text was updated successfully, but these errors were encountered: