From 0aa59111df23b38da487e4e9f9a22bd457b128a2 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Thu, 19 Aug 2021 23:06:55 +0100 Subject: [PATCH] Generic: YaraScanner fail on no rules --- volatility3/framework/plugins/yarascan.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/volatility3/framework/plugins/yarascan.py b/volatility3/framework/plugins/yarascan.py index 3ca436210..86a7426a5 100644 --- a/volatility3/framework/plugins/yarascan.py +++ b/volatility3/framework/plugins/yarascan.py @@ -26,6 +26,8 @@ class YaraScanner(interfaces.layers.ScannerInterface): # yara.Rules isn't exposed, so we can't type this properly def __init__(self, rules) -> None: super().__init__() + if rules is None: + raise ValueError("No rules provided to YaraScanner") self._rules = rules def __call__(self, data: bytes, data_offset: int) -> Iterable[Tuple[int, str, str, bytes]]: