Skip to content

fix null dereference segfault

Adam Ruppe requested to merge adamdruppe/xserver:master into master

I encountered this when playing with the idea of having two mouse pointers setup. The process to trigger it looked something like this:

$ cat crash-nest.sh
xinput float 6
xinput create-master 10 # teh actual id is 8 lol
xinput reattach 6 8
xinput disable 8
xinput enable 8
xinput reattach 6 8

It is possible that the real bug is elsewhere and this is a state that shouldn't happen in the first place, but after apply this path everything is working in some quick tests, and logically if master is null, there is no state to push to slave devices anyway, so I believe it is a reasonable patch.

First time trying to work on this btw, I wasn't sure if the gitlab or an emailed patch like described in the README would be more appropriate, obviously I don't mind going either way, just since I have the gitlab account now I thought i'd try it.

Merge request reports