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

Check return code of xQueryTree and throw on error. #57

Merged
merged 1 commit into from Mar 20, 2018
Merged

Check return code of xQueryTree and throw on error. #57

merged 1 commit into from Mar 20, 2018

Conversation

ghost
Copy link

@ghost ghost commented Dec 22, 2017

Fixes issue #56, where uninitialized memory would be accessed
after xQueryTree failure.

Fixes issue #56, where uninitialized memory would be accessed
after xQueryTree failure.
@ghost
Copy link
Author

ghost commented Mar 19, 2018

Any chance to get this merged, or reason not to?

Currently when XQueryTree fails, the *_return values are uninitialized, and
peekArray will read some arbitrary number of bytes from arbitrary location.
The uninitialized value of *children_return will be used with xFree as well.

In case you are really lucky and everything happens to be zeroed, you might get
an empty list instead, otherwise this is constant source of segmentation faults.

@dmwit dmwit merged commit a07f31c into xmonad:master Mar 20, 2018
@ghost ghost deleted the fix-query-tree branch May 1, 2018 11:22
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