Skip to content

Commit

Permalink
fel: sid: fix segfault with default section map
Browse files Browse the repository at this point in the history
The generic_2k_sid_maps, describing the SID sections for chips where we
don't have any specific information yet, was missing the terminating
NULL section, so we would run off into to woods, beyond the array limit.
This would most commonly result in a segfault:
$ sunxi-fel sid-dump
....
                00000000 00000000 00000000 00000000
Segmentation fault (core dumped)
=================

Add the NULL sentinel to terminate the loop correctly.

Signed-off-by: Andre Przywara <[email protected]>
  • Loading branch information
apritzel committed Apr 11, 2023
1 parent ed3039c commit 6a2f6b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions soc_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ static const sid_section h6_sid_maps[] = {
static const sid_section generic_2k_sid_maps[] = {
SID_SECTION("chipid", 0x00, 128),
SID_SECTION("unknown", 0x10, 1920),
SID_SECTION(NULL, 0, 0),
};

soc_info_t soc_info_table[] = {
Expand Down

0 comments on commit 6a2f6b5

Please sign in to comment.