From d64a07c04c3e03529632d58ee059cf6f77482f76 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Tue, 8 Jun 2021 18:57:57 +0000 Subject: [PATCH] Better guard to prevent accidental lazy serializable hydration --- hippolyzer/lib/base/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hippolyzer/lib/base/objects.py b/hippolyzer/lib/base/objects.py index bcf35d3..0404be5 100644 --- a/hippolyzer/lib/base/objects.py +++ b/hippolyzer/lib/base/objects.py @@ -182,7 +182,7 @@ class Object(recordclass.datatuple): # type: ignore old_val = getattr(self, key, dataclasses.MISSING) # Don't check equality if we're using a lazy proxy, # parsing is deferred until we actually use it. - if isinstance(val, lazy_object_proxy.Proxy): + if any(isinstance(x, lazy_object_proxy.Proxy) for x in (old_val, val)): # TODO: be smarter about this. Can we store the raw bytes and # compare those if it's an unparsed object? if old_val is not val: