Skip to content

Fix crash that occurs when attempting to retrieve the name property of an XMLDocument by making it return nil. #2453

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

Closed
wants to merge 22 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 3, 2019

Runtime crash occurs when one attempts to retrieve XMLDocument's name property. This was due to the lack of checking if Documents were allowed or not to have its name property retrieved.

This came from SR-10776, and a PR has been written, but no tests were run and the PR has not been attended to: #2316.

Unlike the original PR, this PR does not have any changes on XMLDocument in Swift, as there is no need to check for document there, but rather in the _getQName function.

@ghost
Copy link
Author

ghost commented Aug 3, 2019

@swift-ci please test

@YOCKOW
Copy link
Member

YOCKOW commented Aug 4, 2019

My opinions about #2316 and this PR are:

Thank you.

@ghost
Copy link
Author

ghost commented Aug 4, 2019

The reason why it should be in corefoundation is because that is where, according to the crash report you submitted and the crash that happened on my machine, was. The crash happened in that function, where document was allowed to run unchecked.

@ghost
Copy link
Author

ghost commented Aug 4, 2019

I would like to test these changes on here (they passed locally), before I squash the commits just to be sure these bugs are fixed and no new ones are introduced.

@YOCKOW
Copy link
Member

YOCKOW commented Aug 5, 2019

The reason why it should be in corefoundation is because that is where, according to the crash report you submitted and the crash that happened on my machine, was. The crash happened in that function, where document was allowed to run unchecked.

Well, sorry, but I talked about the setter.
Moreover, the setter calls only _CFXMLNodeSetName. I think your PR contains unrelated changes.

I would like to test these changes on here (they passed locally), before I squash the commits just to be sure these bugs are fixed and no new ones are introduced.

You can read @xwu’s comments in your own past PR about that:

@xwu
Copy link
Contributor

xwu commented Aug 5, 2019

@pi1024e:

Again, as a matter of etiquette, it's not cool to take a bug that someone else is clearly still working on with an active pull request; if you're interested in helping to resolve such an issue or disagree with how they've approached the topic, you can review their work and offer to help that person.

@YOCKOW has also pointed out that this PR also contains unrelated changes.

I'm not sure of your level of experience with these things, but these sort of things apply generally to most if not all projects.

@ghost
Copy link
Author

ghost commented Aug 5, 2019

I apologize, as many of these bugs appear to be inactive. I am deeply sorry about this.

@millenomi
Copy link
Contributor

As a separate note, I'm less against mixed-content patches so long that all the changes in a patch are either required for the main part of it to function, or strongly needed to improve its ergonomics.

In general, I do not take cleanup patches to Core Foundation code in the summer because it complicates the process of merging that I do every year in the early fall.

@ghost
Copy link
Author

ghost commented Aug 10, 2019

Fixed it so it is not unnecessary changes! @millenomi

@millenomi
Copy link
Contributor

I took YOCKOW's patch, per discussion on the patch I closed — if we're targeting 5.0 still, we should cherry-pick that one.

@ghost
Copy link
Author

ghost commented Aug 17, 2019

Got it!

@ghost ghost closed this Mar 7, 2020
This pull request was closed.
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