]> begriffs open source - freertos/commit
Fix array-bounds compiler warning on gcc11+ in list.h (#580)
authorArchit Gupta <71798289+archigup@users.noreply.github.com>
Thu, 15 Dec 2022 21:46:32 +0000 (21:46 +0000)
committerGitHub <noreply@github.com>
Thu, 15 Dec 2022 21:46:32 +0000 (13:46 -0800)
commit99d3d54ac4d17474a81c94ec5bab36f55f470359
treed0c5f794c259adc728bd3ff58f1860080e82abf3
parent91927abc0b630e9a499c4dbf34e9b1009eadaff5
Fix array-bounds compiler warning on gcc11+ in list.h (#580)

listGET_OWNER_OF_NEXT_ENTRY computes `( pxConstList )->pxIndex->pxNext` after
verifying that `( pxConstList )->pxIndex` points to `xListEnd`, which due to
being a MiniListItem_t, can be shorter than a ListItem_t. Thus,
`( pxConstList )->pxIndex` is a `ListItem_t *` that extends past the end of the
`List_t` whose `xListEnd` it points to. This is fixed by accessing `pxNext`
through a `MiniListItem_t` instead.
include/list.h