2008-06-20 14:59:04 |
Marc Tardif |
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://www.w3.org/TR/2006/REC-xml-20060816/#charsets
The problem is that the lshw escape function only escapes 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 driver (where ^@ is a NUL character):
<serial>[^@^@^@Optiarc DVD RW AD-7200S 1.04 Dec21,2007</serial>
I have attached a patch which should solve the problem by removing invalid characters altogether. |
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://www.w3.org/TR/2006/REC-xml-20060816/#charsets
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>[^@^@^@Optiarc DVD RW AD-7200S 1.04 Dec21,2007</serial>
I have attached a patch which should solve the problem by removing invalid characters altogether. |
|