Skip to content

Fix array out of bounds for large arrays (#124)#125

Open
rishabhvaish wants to merge 1 commit intoEVerest:mainfrom
rishabhvaish:fix/array-out-of-bounds-124
Open

Fix array out of bounds for large arrays (#124)#125
rishabhvaish wants to merge 1 commit intoEVerest:mainfrom
rishabhvaish:fix/array-out-of-bounds-124

Conversation

@rishabhvaish
Copy link

Summary

  • Restores the m < _max guard in the array grammar loop that was accidentally removed in commit 871fcb3
  • Without this guard, the final array grammar (is_in_array_last=True) is never generated when the LOOP optimization activates
  • This causes EXI_ERROR__ARRAY_OUT_OF_BOUNDS when decoding arrays at their configured maximum size (e.g., ChargeParameterDiscoveryRes with 16 PMaxScheduleEntry elements)

Test plan

  • Generate codec with PMaxScheduleEntryType set to 16 in array optimizations
  • Decode a ChargeParameterDiscoveryRes with 16 PMaxScheduleEntry elements
  • Verify no EXI_ERROR__ARRAY_OUT_OF_BOUNDS error

Fixes #124

In commit 871fcb3, the condition 'if skip_to_end and m < _max' was
simplified to 'if skip_to_end', causing the final array grammar to be
skipped when the LOOP optimization activates.

Fixes EVerest#124

Signed-off-by: Rishabh Vaish <rishabhvaish.904@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Array out of bounds if number of PMaxScheduleEntry is too high

2 participants