[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:
3 files changed
+5
-2
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user