From bf80b6c3ba51173655be6e175dc1f26a90eb60fd Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 28 Apr 2016 15:18:53 +0200 Subject: [PATCH] fixed bug in json2ascii (was producing too much output due to wrong test) --- oletools/olevba.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oletools/olevba.py b/oletools/olevba.py index 257e071..1451102 100755 --- a/oletools/olevba.py +++ b/oletools/olevba.py @@ -1780,8 +1780,9 @@ def json2ascii(json_obj, encoding='utf8', errors='replace'): elif isinstance(json_obj, (bool, int, float)): pass elif isinstance(json_obj, str): + # de-code and re-encode dencoded = json_obj.decode(encoding, errors).encode(encoding, errors) - if dencoded != str: + if dencoded != json_obj: log.info('json2ascii: replaced: {0} (len {1})' .format(json_obj, len(json_obj))) log.info('json2ascii: with: {0} (len {1})' -- libgit2 0.21.4