Skip to content

Work around crash in Google Chrome when navigating tweets on twitter.com#8779

Merged
michaelDCurran merged 3 commits into
rcfrom
i8777
Sep 26, 2018
Merged

Work around crash in Google Chrome when navigating tweets on twitter.com#8779
michaelDCurran merged 3 commits into
rcfrom
i8777

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #8777

Summary of the issue:

Google Chrome crashes when navigating tweets in twitter.com due to a buffer overrun in Chrome's implementation of IAccessible2_2::relationTargetsOfType.
NVDA started calling relationTargetsOfType in pr #8352.

Description of how this pull request fixes the issue:

This PR works around the crash by making use of the fact that chrome's relationTargetsOftype works okay when requesting all targets (numRelations is 0) rather than a specific number of them that may be smaller than the total amount.

Testing performed:

Tested NVDA and Chrome using the testcases in #8777.
And again with tests in pr #8352

Known issues with pull request:

None.

Change log entry:

Already in PR.

…n twitter.com due to IAccessible2_2::relationTargetsOfType buffer overrunning.
@michaelDCurran

michaelDCurran commented Sep 25, 2018

Copy link
Copy Markdown
Member Author

As this is a crash introduced in the 2018.3 release cycle, this should be made available in a 2018.3 minor release.
@feerrenrut could you please review this with priority so I can release an rc and then 2018.3.2.

// Therefore, If this is Chrome, request all targets (by setting numRelations to 0) as this works around the bug.
// There is no major performance hit to fetch all targets in Chrome as Chrome is already fetching all targets either way.
// In Firefox there would be extra cross-proc calls.
if(this->toolkitName.compare(L"Chrome")==0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

toolkitName might be null. This function should probably check for this.

@michaelDCurran

michaelDCurran commented Sep 25, 2018 via email

Copy link
Copy Markdown
Member Author

@feerrenrut

Copy link
Copy Markdown
Contributor

Oh, of course it is. But then its assigned from a BSTR, I think this needs to be:

this->toolkitName = std::wstring(toolkitName, SysStringLen(toolkitName));

Check https://stackoverflow.com/a/6284978

@michaelDCurran

michaelDCurran commented Sep 25, 2018 via email

Copy link
Copy Markdown
Member Author

@michaelDCurran michaelDCurran merged commit 1d464fe into rc Sep 26, 2018
@nvaccessAuto nvaccessAuto added this to the 2018.4 milestone Sep 26, 2018
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.

3 participants