From 9c3ad5588a585d9f09fd338069d5dcf79eb6eb3b Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Wed, 9 Aug 2017 18:06:35 +0100 Subject: [PATCH] Improve the error handling the LinuxSymbolCache. --- volatility/framework/automagic/linux_symbol_cache.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/volatility/framework/automagic/linux_symbol_cache.py b/volatility/framework/automagic/linux_symbol_cache.py index a9e05c6f2..98f73a1ca 100644 --- a/volatility/framework/automagic/linux_symbol_cache.py +++ b/volatility/framework/automagic/linux_symbol_cache.py @@ -47,8 +47,12 @@ class LinuxSymbolCache(interfaces.automagic.AutomagicInterface): # Favour specific name, over uncompressed JSON (user-editable), over compressed JSON over uncompressed files for extension in ['.json', '.json.xz']: # Hopefully these will not be large lists, otherwise this might be slow - cacheables += [x.as_uri() for x in - pathlib.Path(path).joinpath('linux').resolve().rglob('*' + extension)] + try: + cacheables += [x.as_uri() for x in + pathlib.Path(path).joinpath('linux').resolve().rglob('*' + extension)] + except FileNotFoundError: + # If there's no linux symbols, don't cry about it + pass for banner in linuxbanners: for json_file in linuxbanners[banner]: