From 60ec8a39fff6bc53da653adf2c54f87c3a0d20f9 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sun, 13 Nov 2022 18:37:19 +0000 Subject: [PATCH] Core: Fix another github scanning issue. --- volatility3/framework/symbols/windows/pdbconv.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/volatility3/framework/symbols/windows/pdbconv.py b/volatility3/framework/symbols/windows/pdbconv.py index d7d171ce1..4809aafcf 100644 --- a/volatility3/framework/symbols/windows/pdbconv.py +++ b/volatility3/framework/symbols/windows/pdbconv.py @@ -926,15 +926,16 @@ class PdbRetreiver: try: vollog.debug(f"Attempting to retrieve {url + suffix}") # We have to cache this because the file is opened by a layer and we can't control whether that caches - result = resources.ResourceAccessor(progress_callback).open(url + suffix) + with resources.ResourceAccessor(progress_callback).open(url + suffix) as fp: + fp.read(10) + result = True except (error.HTTPError, error.URLError) as excp: vollog.debug(f"Failed with {excp}") if result: break if progress_callback is not None: progress_callback(100, f"Downloading {url + suffix}") - if result is None: - result.close() + if not result: return None return url + suffix