aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRaymond Mao2024-02-03 08:36:21 -0800
committerTom Rini2024-02-29 09:24:22 -0500
commit67254214930cd2cb52279b01690c1f820a7f83db (patch)
tree66583957697b633a9f826a7d3a029ee84606f032 /common
parent1c4751fd1ac7bda72ab72ce352dc9b2131df2807 (diff)
bloblist: check bloblist with specified buffer size
Instead of expecting the bloblist total size to be the same as the pre-allocated buffer size, practically we are more interested in whether the pre-allocated buffer size is bigger than the bloblist total size. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'common')
-rw-r--r--common/bloblist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/bloblist.c b/common/bloblist.c
index 980b1ddbcb4..26b0ba33b11 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -384,7 +384,7 @@ int bloblist_check(ulong addr, uint size)
return log_msg_ret("Bad magic", -ENOENT);
if (hdr->version != BLOBLIST_VERSION)
return log_msg_ret("Bad version", -EPROTONOSUPPORT);
- if (!hdr->total_size || (size && hdr->total_size != size))
+ if (!hdr->total_size || (size && hdr->total_size > size))
return log_msg_ret("Bad total size", -EFBIG);
if (hdr->used_size > hdr->total_size)
return log_msg_ret("Bad used size", -ENOENT);