Package: barcode
Version: 0.99-3
Severity: normal
Tags: upstream

Dear Maintainer,

barcode does not correctly encode XML characters in svg output mode (-S),
leading at least to broken SVG documents. The plain text of the barcode is
embedded three times into the SVG document: Twice in a comment before and after
the actual barcode, once in a character-by-character fashion to show the
contents of the barcode.

When creating a "128" barcode of the character "<", this breaks the SVG file in
the character-by-character display:

$ barcode -S -e 128 -b "<"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"; version="1.1" width="66pt" 
height="100pt">
<rect x="0pt" y="0pt" width="66pt" height="100pt" 
style="fill:#ffffff;fill-opacity:1" />
<!-- Printing barcode for "<", scaled  1.00, encoded using "code 128" -->
<!-- The space/bar succession is represented by the following widths (space 
first): 02112143221123222112331112 -->
[...]
<text x="21.000000pt" y="90.000000pt" fill="black" 
style="font-family:Helvetica;font-size:12pt"><</text>
<!-- End barcode for "<" -->
</svg>


Similarly, it is possible to break out of the comments:
$ barcode -S -e 128 -b "\"--><text>123</text>"

Reply via email to