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 LT-21839: Avoid crash and allow paste success with no ws #174

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

jasonleenaylor
Copy link
Contributor

@jasonleenaylor jasonleenaylor commented Oct 4, 2024

Analyzing the data that caused the crash showed that in some edge
cases no writing system can be identified in MakeSubString.
This could cause an empty builder to have no writing system.
I couldn't identify any actual side effects in this edge case so
I left the assert, but allowed the paste to succeed


This change is Reviewable

jasonleenaylor and others added 3 commits October 1, 2024 09:42
   Analyzing the data that caused the crash showed that in some edge
   cases no writing system can be identified in MakeSubString.
   This could cause an empty builder to have no writing system.
   I couldn't identify any actual side effects in this edge case so
   I left the assert, but allowed the paste to succeed
Copy link
Contributor

@JakeOliver28 JakeOliver28 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor)


Src/views/VwSelection.cpp line 5358 at r1 (raw file):

			}

			if(wsNew <= 0)

Could we just put the Assert and return inside of the first "if (wsNew <=0)" instead of having a duplicate if statement?

@jasonleenaylor
Copy link
Contributor Author

Src/views/VwSelection.cpp line 5358 at r1 (raw file):

Previously, JakeOliver28 (Jake Oliver) wrote…

Could we just put the Assert and return inside of the first "if (wsNes <=0)" instead of having a duplicate if statement?

Good question. The value could have been changed inside of the first if statement, this covers the case where there is no m_qtsbProp and also if trying to get the writing system from those properties fails.

@jasonleenaylor
Copy link
Contributor Author

Src/views/VwSelection.cpp line 5358 at r1 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Good question. The value could have been changed inside of the first if statement, this covers the case where there is no m_qtsbProp and also if trying to get the writing system from those properties fails.

Hmm, I retract, we can still put this inside the first if.

@jasonleenaylor
Copy link
Contributor Author

Src/views/VwSelection.cpp line 5358 at r1 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Hmm, I retract, we can still put this inside the first if.

After drinking more coffee I retract my retraction, if we want it to 'return' under the correct conditions a second check is necessary even if we put it inside the first if. So this way reduces the nesting.

Copy link
Contributor

@JakeOliver28 JakeOliver28 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion

@JakeOliver28 JakeOliver28 merged commit d09b8b7 into release/9.1 Oct 7, 2024
4 of 5 checks passed
@JakeOliver28 JakeOliver28 deleted the LT-21839 branch October 7, 2024 19:06
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.

2 participants