aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2025-05-29 19:27:39 -0400
committerKevin O'Connor <kevin@koconnor.net>2025-05-29 19:30:45 -0400
commit8d7e4871492d5a8e89e58da7865e686b07ec5842 (patch)
tree1d4aa2b031b890556087a43d0b15b70317add2ef /klippy
parenteb43b20e3b3555a4e94b84a8df4d6095909fc077 (diff)
downloadkutter-8d7e4871492d5a8e89e58da7865e686b07ec5842.tar.gz
kutter-8d7e4871492d5a8e89e58da7865e686b07ec5842.tar.xz
kutter-8d7e4871492d5a8e89e58da7865e686b07ec5842.zip
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>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/extras/sos_filter.py2
1 files changed, 1 insertions, 1 deletions
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)