lshw -xml reporting invalid xml

Bug #241675 reported by Marc Tardif
8
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://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.

Revision history for this message
Marc Tardif (cr3) wrote :
description: updated
Revision history for this message
Darik Horn (dajhorn) wrote :

I can confirm the bug. I am trying the patch now.

Revision history for this message
Jonathan Davies (jpds) wrote :

Patch was committed upstream: http://ezix.org/project/changeset/2114

Changed in lshw (Ubuntu):
status: New → Fix Committed
Revision history for this message
Nigel Babu (nigelbabu) wrote :

Fixed in new upstream release.

Changed in lshw (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.