Skip to content

Commit 60ec8a3

Browse files
committed
Core: Fix another github scanning issue.
1 parent dd876ae commit 60ec8a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

volatility3/framework/symbols/windows/pdbconv.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,15 +926,16 @@ def retreive_pdb(self,
926926
try:
927927
vollog.debug(f"Attempting to retrieve {url + suffix}")
928928
# We have to cache this because the file is opened by a layer and we can't control whether that caches
929-
result = resources.ResourceAccessor(progress_callback).open(url + suffix)
929+
with resources.ResourceAccessor(progress_callback).open(url + suffix) as fp:
930+
fp.read(10)
931+
result = True
930932
except (error.HTTPError, error.URLError) as excp:
931933
vollog.debug(f"Failed with {excp}")
932934
if result:
933935
break
934936
if progress_callback is not None:
935937
progress_callback(100, f"Downloading {url + suffix}")
936-
if result is None:
937-
result.close()
938+
if not result:
938939
return None
939940
return url + suffix
940941

0 commit comments

Comments
 (0)