From ad619bc0d86d4909c77bf5235f2c83bd2983d452 Mon Sep 17 00:00:00 2001 From: qux-bbb <1147635419@qq.com> Date: Sat, 4 Jul 2020 16:33:57 +0800 Subject: [PATCH] Update utils.py some string is "", add this can avoid exception. --- cuckoo/common/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cuckoo/common/utils.py b/cuckoo/common/utils.py index 2e9e4c8c9d..5ce38e0c8e 100644 --- a/cuckoo/common/utils.py +++ b/cuckoo/common/utils.py @@ -184,6 +184,9 @@ def chardet_enc(s2): # If already in unicode, skip. if isinstance(s, unicode): return s + + if s == "": + return unicode(s) # First try to decode against a little set of common encodings. result = brute_enc(s)