1
0
mirror of https://github.com/GNS3/gns3-server synced 2025-03-08 04:36:15 +00:00

Fix crash when you import a corrupted SVG

Fix #746
This commit is contained in:
Julien Duponchelle 2016-10-28 10:06:02 +02:00
parent 4a5066c2a5
commit 53e6ee1b3a
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -92,7 +92,11 @@ class Drawing:
self._svg = value
return
root = ET.fromstring(value)
try:
root = ET.fromstring(value)
except ET.ParseError as e:
log.error("Can't parse SVG: {}".format(e))
return
# SVG is the default namespace no need to prefix it
ET.register_namespace('xmlns', "http://www.w3.org/2000/svg")
ET.register_namespace('xmlns:xlink', "http://www.w3.org/1999/xlink")