encoding/xml: accepts names containing :
followed by a character that cannot start a Name
#68392
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
1.22
Output of
go env
in your module/workspace:What did you do?
Ran the following Go code:
What did you see happen?
No error?
displayed, indicating successful unmarshaling.What did you expect to see?
Parsing should fail because
a:1
isn’t a valid XML QName. This is because a QName is either one NCName (a Name with no:
) or two NCNames separated by:
.1
isn’t a valid Name, so it isn’t a valid QName either.The simplest fix (which will also fix #68393) is to remove
:
from the list of characters valid in a Name, and instead havensname()
work in two steps::
.The text was updated successfully, but these errors were encountered: