Message ID | 20250325065031.3263718-7-mjt@tls.msk.ru (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Patch Round-up for stable 7.2.17, freeze on 2025-03-24 (frozen) | expand |
diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c index 69175e972d..11bd25708e 100644 --- a/hw/misc/aspeed_hace.c +++ b/hw/misc/aspeed_hace.c @@ -123,6 +123,11 @@ static bool has_padding(AspeedHACEState *s, struct iovec *iov, if (*total_msg_len <= s->total_req_len) { uint32_t padding_size = s->total_req_len - *total_msg_len; uint8_t *padding = iov->iov_base; + + if (padding_size > req_len) { + return false; + } + *pad_offset = req_len - padding_size; if (padding[*pad_offset] == 0x80) { return true;