Conversation
381748a to
7ffe91b
Compare
| static const unsigned char ps2_init[] = { | ||
| PSMC_ENABLE_DEV, | ||
| 0, | ||
| PSMC_ENABLE_DEV |
There was a problem hiding this comment.
how does removing these 0's fix a segfault ?
|
this commit changes 4 things, but none of the changes are explained. |
I can make separate commits. I assumed you would prefer having all changes in a single commit. |
e504a2c to
c344bd6
Compare
This fixes an incorrect loop condtion, as it is possible to skip over NUM_PROT when incrementing This causes a segfault in kdrive, when km->i_prot would have to loop, instead continuing to read out of bounds. I couldn't get tinyx to also segfault, but that doesn't mean it's impossible. It might happen on different hardware.
c344bd6 to
5f3cd22
Compare
Done. |
We know the size of the ps/2 init bytes at compile time. No need to call strlen.
a32f227 to
c8fd8e5
Compare
This fixes a segfault in the kdrive mouse driver.
I haven't managed to get tinyx to segfault, because the ability to pass mouse protocol by command line args seems to not be implemented.
Still, this doesn't mean that the segfault can't happen here too. It doesn't happen on my system because the default ps/2 protocol works fine for me. However, this might not be the case on other systems.
This code fixes an incorrect loop condition and adds a fallback for unknown mouse protocols.
Also replaces strlen with sizeof appropriately.