提交 99eaf1fc 编写于 作者: S Simon Glass 提交者: Tom Rini

cbfs: Check offset range when reading a file

Add a check that the offset is within the allowed range.
Signed-off-by: NSimon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 331155)
上级 15dd815c
......@@ -167,6 +167,8 @@ static int file_cbfs_next_file(struct cbfs_priv *priv, void *start, int size,
}
swap_file_header(&header, file_header);
if (header.offset >= size)
return log_msg_ret("range", -E2BIG);
ret = fill_node(node, start, &header);
if (ret) {
priv->result = CBFS_BAD_FILE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册