Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pageMaxRow use before update #8222

Merged
merged 1 commit into from
May 9, 2019
Merged

Conversation

timower
Copy link
Contributor

@timower timower commented May 7, 2019

After commit d2e7abd the for loop following my change use pageMaxRow to determine which flags to clear.
But this pageMaxRow value is updated after the loop, which caused a crash in a very specific circumstance:

1 open the CMS OSD menu and go to profile

2 close the profile by yaw right, select exit

3 open CMS OSD menu and go to profile again

This caused a crash as runtimeEntryFlags wasn't cleared properly and the Copy Profile entry's flags still indicated OPTSTRING somehow.
which caused it's CMSEntryFuncPtr function to be cast to OPTSTRING and called without arguments.

After commit d2e7abd the for loop following my change use pageMaxRow to determine which flags to clear.
But this pageMaxRow value is updated after the loop, which caused a crash in a very specific circumstance:

1 open the CMS OSD menu and go to profile

2 close the profile by yaw right, select exit

3 open CMS OSD menu and go to profile again

This caused a crash as runtimeEntryFlags wasn't cleared properly and the Copy Profile entry's flags still indicated OPTSTRING somehow.
which caused it's CMSEntryFuncPtr function to be cast to OPTSTRING and called without arguments.
@mikeller mikeller added this to the 4.0.3 milestone May 8, 2019
@mikeller mikeller merged commit a4ac70b into betaflight:master May 9, 2019
mikeller added a commit that referenced this pull request May 9, 2019
Fix pageMaxRow use before update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants