ipa: raspberrypi: Fix possible buffer overrun in metadata parsing
The SMIA metadata parser could possibly read one byte past the end of the buffer as the buffer size test ran after the read operation. Fix this. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
969da31894
commit
a4b876e97f
1 changed files with 2 additions and 2 deletions
|
@ -71,8 +71,8 @@ MdParserSmia::ParseStatus MdParserSmia::findRegs(libcamera::Span<const uint8_t>
|
|||
return NO_LINE_START;
|
||||
} else {
|
||||
/* allow a zero line length to mean "hunt for the next line" */
|
||||
while (buffer[current_offset] != LINE_START &&
|
||||
current_offset < buffer.size())
|
||||
while (current_offset < buffer.size() &&
|
||||
buffer[current_offset] != LINE_START)
|
||||
current_offset++;
|
||||
|
||||
if (current_offset == buffer.size())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue