Review Request 125295: Fix casting in mouse KCM init

David Edmundson david at davidedmundson.co.uk
Thu Sep 17 23:47:17 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125295/#review85602
-----------------------------------------------------------


[00:35] <fredrikh> d_ed: "valgrind warning about something about a thing" = "invalid read of size 4 [...]  inside a block of size 1 alloc'd"?

[00:36] <fredrikh> d_ed: it's an 8 bit property as indicated by format_return, and your patch fixes it by not casting the unsigned char pointer to a Bool (aka int) before dereferencing it
[00:40] <fredrikh> because the latter tells the compiler to do a 32 bit read, while the former tells it to do an 8 bit read and cast the resulting value to 32 bit

- David Edmundson


On Sept. 17, 2015, 9:26 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125295/
> -----------------------------------------------------------
> 
> (Updated Sept. 17, 2015, 9:26 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Repository: plasma-desktop
> 
> 
> Description
> -------
> 
> We fetch 32 bits of data in XIGetProperty
> 
> This should be casted into a Bool, which comes from Xlib which is set to
> an int (also always 32 bits).
> 
> The current code casts it to Bool* which is arch dependent, meaning on
> 64 bit systems we just read random data.
> 
> 
> Diffs
> -----
> 
>   kcms/input/mouse.cpp c2bd0d0131339d835bf26f5e09768b96875c3142 
> 
> Diff: https://git.reviewboard.kde.org/r/125295/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20150917/7ef02e1d/attachment.html>


More information about the Plasma-devel mailing list