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 WebView2 accessibility crash in ProviderWrapper::GetRuntimeId #7345

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

DmitriyKomin
Copy link
Contributor

ProviderWrapper::GetRuntimeId used for WebView2 accessibility is reported to be consistently crashing on some machines. From inspection this appears to be due to incorrect lLBounds being passed in:
SAFEARRAY* psa = SafeArrayCreateVector(VT_I4, 1, 2)

lLBounds specifies the lower bound for the safe array and is usually set to 0. Here it is incorrectly set to 1, presumably causing a crash in some environments when we try to set the 0’th index via SafeArrayPutElement a few lines later.

Also added check for possible out-of-memory condition from SafeArrayCreateVector.

@DmitriyKomin DmitriyKomin requested review from jevansaks and krschau July 8, 2022 17:24
@DmitriyKomin DmitriyKomin self-assigned this Jul 8, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jul 8, 2022
@DmitriyKomin DmitriyKomin added this to the WinUI 2.8 milestone Jul 8, 2022
@DmitriyKomin
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@codendone codendone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@krschau krschau merged commit eb0f8ef into main Jul 11, 2022
@krschau krschau deleted the user/dkomin/get_runtime_id_crash branch July 11, 2022 16:14
@krschau krschau removed the needs-triage Issue needs to be triaged by the area owners label Jul 11, 2022
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.

4 participants