lshw -xml reporting invalid xml
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lshw (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
According to the XML 1.0 standard, these are the characters allowed between tags:
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
For reference purposes, here is the direct link to the W3 standard:
http://
The problem is that the lshw escape function only generates entities from special characters, such as "<", ">" and "&". However, it lets characters outside the allowed set to result in the output. For example, here is output I have encountered recently from the serial number of a CDROM device (where ^@ is a NUL character):
<serial>
I have attached a patch which should solve the problem by removing invalid characters altogether.
I can confirm the bug. I am trying the patch now.