1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

libflashrom.c: Use correct type for sizeof

As we want to allocate an array of `flashrom_board_info` structs, use
that type in sizeof. This did not cause problems as `board_info` was at
least as big as `flashrom_board_info`, but nothing guarantees it.

Change-Id: I66e875d54c9a7cc59898b072b052282b0b5cbb2f
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39973
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Michael Niewöhner
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Angel Pons 2020-03-31 15:13:48 +02:00
parent 84bfddca69
commit 3ef0df067b

View File

@ -182,7 +182,7 @@ struct flashrom_board_info *flashrom_supported_boards(void)
++boards_known_size;
struct flashrom_board_info *supported_boards =
malloc(boards_known_size * sizeof(*binfo));
malloc(boards_known_size * sizeof(struct flashrom_board_info));
if (supported_boards != NULL) {
for (; i < boards_known_size; ++i) {