summaryrefslogtreecommitdiffstats
path: root/libflashrom.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-06-15 15:44:39 +0200
committerNico Huber <nico.h@gmx.de>2021-06-26 15:53:31 +0000
commit7ebd578100e6526ef46c98cb9978d692160d8179 (patch)
treef87dc8068f97aa101ae4151dba40a9fd7dc77273 /libflashrom.c
parent06a89d713951a2e08ef8fb698a7688357baa83d1 (diff)
downloadflashrom-7ebd578100e6526ef46c98cb9978d692160d8179.tar.gz
flashrom-7ebd578100e6526ef46c98cb9978d692160d8179.tar.bz2
flashrom-7ebd578100e6526ef46c98cb9978d692160d8179.zip
layout: Add `capacity` field
Use it to keep track of the size of the `entries` array. An interim solution until we have dynamic allocation. Change-Id: Ib5f431bc0a72a79a53fa1376c3417942b19dd3a0 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33516 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'libflashrom.c')
-rw-r--r--libflashrom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libflashrom.c b/libflashrom.c
index c6a598b60..2a39a80dd 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -506,7 +506,7 @@ static int flashrom_layout_parse_fmap(struct flashrom_layout **layout,
if (!fmap || !l)
return 1;
- if (l->num_entries + fmap->nareas > MAX_ROMLAYOUT) {
+ if (l->num_entries + fmap->nareas > l->capacity) {
msg_gerr("Cannot add fmap entries to layout - Too many entries.\n");
return 1;
}