[Libreoffice-commits] mso-dumper.git: msodumper/msodraw.py
Miklos Vajna
vmiklos at collabora.co.uk
Wed Sep 10 04:41:27 PDT 2014
msodumper/msodraw.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit f6d4a8588d9eba8139ee399cd53fbdc0b1a62cf7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Sep 10 13:40:07 2014 +0200
msodraw: avoid dumping too large files in BlipEMF::dumpXml()
I'm not sure what would be a reasonable limit, I just came up with this
one to avoid hang on a document I wanted to inspect.
diff --git a/msodumper/msodraw.py b/msodumper/msodraw.py
index cfaf245..1e9c58f 100644
--- a/msodumper/msodraw.py
+++ b/msodumper/msodraw.py
@@ -349,7 +349,11 @@ class BlipEMF:
recHdl.appendLine('<rgbUid2 value="%s"/>' % hexdump(self.rgbUid2))
self.metafileHeader.dumpXml(recHdl, model, rh)
if self.metafileHeader.compression == 0x00:
- recHdl.appendLine('<BLIPFileData value="%s"/>' % inflate(self.BLIPFileData))
+ # No idea if this is a reasonable limit.
+ if len(self.BLIPFileData) > pow(2, 18):
+ recHdl.appendLine('<info what="BLIPFileData size is too large (%s bytes), skipping"/>' % len(self.BLIPFileData))
+ else:
+ recHdl.appendLine('<BLIPFileData value="%s"/>' % inflate(self.BLIPFileData))
else:
recHdl.appendLine('<todo what="BlipEMF::dumpXml(): unexpected metafileHeader.compression == %s"/>' % hex(self.metafileHeader.compression))
recHdl.appendLine('</blipEmf>')
More information about the Libreoffice-commits
mailing list