[rc522][sml][kamstrup_kmp] Fix buffer bounds checks (#14515)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jonathan Swoboda
2026-03-05 09:46:56 -10:00
committed by GitHub
co-authored by Claude Opus 4.6 J. Nick Koston
parent 6f0460b0ee
commit 05ddc85412
3 changed files with 5 additions and 2 deletions
+2
View File
@@ -35,6 +35,8 @@ bool SmlFile::setup_node(SmlNode *node) {
// Check if we need additional length bytes
if (overlength) {
if (this->pos_ + 1 >= this->buffer_.size())
return false;
// Shift the current length to the higher nibble
// and add the lower nibble of the next byte to the length
length = (length << 4) + (this->buffer_[this->pos_ + 1] & 0x0f);