From 3cff5edffeaab34fc6ada4a665752062421115a7 Mon Sep 17 00:00:00 2001 From: Oran Nadler Date: Tue, 15 May 2018 13:49:23 +0300 Subject: [PATCH] deepcopy cahced object before returing it --- monkey_island/cc/resources/pthmap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey_island/cc/resources/pthmap.py b/monkey_island/cc/resources/pthmap.py index 68a0c998e..ffb681c75 100644 --- a/monkey_island/cc/resources/pthmap.py +++ b/monkey_island/cc/resources/pthmap.py @@ -1,5 +1,6 @@ import hashlib import binascii +import copy from pymongo import MongoClient class mongo(object): @@ -106,7 +107,7 @@ def cache(foo): if hashed not in foo._mycache_.keys(): foo._mycache_[hashed] = foo(*args, **kwargs) - return foo._mycache_[hashed] + return copy.deepcopy(foo._mycache_[hashed]) return wrapper