From bda1c3c4ccd8b625db2871ae608d11ca91abbd8f Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 12 Nov 2011 13:05:25 +0100 Subject: [PATCH] [entropy.tools] dump_entropy_metadata: check against None rather than using "not" --- lib/entropy/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/entropy/tools.py b/lib/entropy/tools.py index 259f4f1b6..b64622e7a 100644 --- a/lib/entropy/tools.py +++ b/lib/entropy/tools.py @@ -1499,6 +1499,7 @@ def dump_entropy_metadata(entropy_package_file, entropy_metadata_file): return False # avoid security flaw caused by file size growing race condition # we conside the file size static + start_position = None if f_size < mmap_size_th: # use mmap try: @@ -1512,7 +1513,7 @@ def dump_entropy_metadata(entropy_package_file, entropy_metadata_file): if old_mmap is None: start_position = _locate_edb(old) - if not start_position: + if start_position is None: return False with open(entropy_metadata_file, "wb") as db: