Uninitialized memory access in queryTree
Closed this issue · 2 comments
Deleted user commented
Wrapper around XQueryTree (i.e., queryTree) omits return status checks and unconditionally accesses return parameters. There is no guarantee that in case of an error those will be initialized, and thus it can end up accessing uninitialized memory.
One way to fix it would be to add throwIfZero. Though, given how this function is currently used (I looked at xmonad and arbtt) simply returning (0, 0, []) could be reasonable as well.
geekosaur commented
There's an ongoing process auditing X11 for stuff like this; check the
issue tracker.
…On Fri, Dec 8, 2017 at 7:35 AM, Tomasz Miąsko ***@***.***> wrote:
Wrapper around XQueryTree (i.e., queryTree) omits return status checks and
unconditionally accesses return parameters. There is no guarantee that in
case of an error those will be initialized, and thus it can end up
accessing uninitialized memory.
One way to fix it would be to add throwIfZero. Though, given how this
function is currently used (I looked at xmonad and arbtt) simply returning
(0, 0, []) could be reasonable as well.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#56>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB8SoE93OAuhSeWbtGicFsy4NxfLn279ks5s-S0ggaJpZM4Q7CPg>
.
--
brandon s allbery kf8nh sine nomine associates
allbery.b@gmail.com ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Deleted user commented
I created a small PR #57 that addresses this issue by throwing error. This
shouldn't interfere with work you have mentioned, because so far changes
suggested there don't fix this particular issue.