sos_filter: Improve error checking on section_idx
Validate host provided index prior to accessing memory using that index. Also, consistently use a uint8_t for max_sections (to account for integer overflow issues). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -176,7 +176,7 @@ class SosFilter:
|
||||
|
||||
# create an uninitialized filter object
|
||||
def create_filter(self):
|
||||
self._mcu.add_config_cmd("config_sos_filter oid=%d max_sections=%u"
|
||||
self._mcu.add_config_cmd("config_sos_filter oid=%d max_sections=%d"
|
||||
% (self._oid, self._max_sections))
|
||||
self._configure_filter(is_init=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user