From 8d7e4871492d5a8e89e58da7865e686b07ec5842 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 29 May 2025 19:27:39 -0400 Subject: 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 --- klippy/extras/sos_filter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'klippy') diff --git a/klippy/extras/sos_filter.py b/klippy/extras/sos_filter.py index f5ba3c27..8c405782 100644 --- a/klippy/extras/sos_filter.py +++ b/klippy/extras/sos_filter.py @@ -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) -- cgit v1.2.3-70-g09d2