From 6e5bf5fef6539a8c5df1a678318121c90a65cf67 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 16 Mar 2019 04:22:49 +0100 Subject: [PATCH] Decode masgpack hash key values as byte --- src/util/Msgpack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/Msgpack.py b/src/util/Msgpack.py index c39bc960..7c7e0369 100644 --- a/src/util/Msgpack.py +++ b/src/util/Msgpack.py @@ -65,7 +65,7 @@ def objectDecoderHook(obj): for key, val in obj: if type(key) is bytes: key = key.decode("utf8") - if key in bin_value_keys or type(val) is not bytes: + if key in bin_value_keys or type(val) is not bytes or len(key) >= 64: back[key] = val else: back[key] = val.decode("utf8") @@ -100,4 +100,4 @@ def numUnprocessedBytes(unpacker): num_bytes = unpacker_bytes - unpacker.tell() else: num_bytes = unpacker._fb_buf_n - unpacker._fb_buf_o - return num_bytes \ No newline at end of file + return num_bytes