]> git.ipfire.org Git - thirdparty/grub.git/commit
lib/reed_solomon: Fix array subscript 0 is outside array bounds
authorMichael Chang <mchang@suse.com>
Mon, 28 Mar 2022 07:00:54 +0000 (15:00 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 20 Apr 2022 16:29:00 +0000 (18:29 +0200)
commit3ce13d974b887338ae972c79b41ff6fc0eee6388
tree3306069df4cd070bda80b829042d6872c6012126
parentacffb81485e35e1f28152949a1c6e1d4dbf5172e
lib/reed_solomon: Fix array subscript 0 is outside array bounds

The grub_absolute_pointer() is a compound expression that can only work
within a function. We are out of luck here when the pointer variables
require global definition due to ATTRIBUTE_TEXT that have to use fully
initialized global definition because of the way linkers work.

  static gf_single_t * const gf_powx ATTRIBUTE_TEXT = (void *) 0x100000;

For the reason given above, use GCC diagnostic pragmas to suppress the
array-bounds warning.

Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/lib/reed_solomon.c