You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble with getting the _NET_ACTIVE_WINDOW atom right after X is started.
Most likely it's due to the fact that at that time the atom is not set.
Xcb doesn't returns an error and instead returns an invalid reply.
After that the bogus reply is passed to this from function.
It looks like this should be a problem with other atoms but I didn't try.
I think this should be fixed in the caller (wait_for_reply and wait_for_reply_unchecked) by checking if the returned reply has 0 length.
Something like this:
pubfnwait_for_reply<C>(&self,cookie:C) -> xcb::Result<C::Reply>whereC:EwmhPropertyCookieChecked,{let xcb_reply = self.con.wait_for_reply(cookie.inner());match xcb_reply{Ok(reply) => {if reply.length() == 0{returnErr(/*not sure which error to use here*/)}else{Ok(reply.into())}},Err(e) => Err(e),}}
The text was updated successfully, but these errors were encountered:
fiorematteo
changed the title
Indexing into invalid replies causes
Indexing into invalid replies causes panic
Oct 19, 2022
I'm having trouble with getting the
_NET_ACTIVE_WINDOW
atom right after X is started.Most likely it's due to the fact that at that time the atom is not set.
Xcb doesn't returns an error and instead returns an invalid reply.
After that the bogus reply is passed to this
from
function.reply.value::<u32>()
returns an empty slice so indexing it panics.This is what a bad reply looks like:
Trying to debug print reply blows up with this scary error
It looks like this should be a problem with other atoms but I didn't try.
I think this should be fixed in the caller (
wait_for_reply
andwait_for_reply_unchecked
) by checking if the returned reply has 0 length.Something like this:
The text was updated successfully, but these errors were encountered: