From 425a038a60600a3f15b78671c95f1922264dbe2a Mon Sep 17 00:00:00 2001 From: Vincent Brillault Date: Tue, 22 May 2018 22:34:30 +0200 Subject: [PATCH] oleform: fail cleanly in case of unsupported content --- oletools/oleform.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oletools/oleform.py b/oletools/oleform.py index 245a102..775543e 100644 --- a/oletools/oleform.py +++ b/oletools/oleform.py @@ -201,7 +201,7 @@ def consume_OleSiteConcreteControl(stream): name = stream.read(name_len) tag = stream.read(tag_len) return {'name': name, 'tag': tag, 'id': id, 'tabindex': tabindex, - 'ClsidCacheIndex': ClsidCacheIndex} + 'ClsidCacheIndex': ClsidCacheIndex, 'value': None} def consume_FormControl(stream): # FormControl: [MS-OFORMS] 2.2.10.1 @@ -294,10 +294,9 @@ def extract_OleFormVariables(ole_file, stream_dir): data = ExtendedStream.open(ole_file, '/'.join(stream_dir + ['o'])) for var in variables: if var['ClsidCacheIndex'] != 23: - #raise OleFormParsingError('Unsupported stored type: {0}'.format(str(var['ClsidCacheIndex']))) # TODO: use logging instead of print print('ERROR: Unsupported stored type in user form: {0}'.format(str(var['ClsidCacheIndex']))) - var['value'] = None + break else: var['value'] = consume_MorphDataControl(data) return variables -- libgit2 0.21.4