Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
src/cursor: fix xfc NULL pointer dereference
xfc->width and xfc->height for the XFixes cursor image returned from
XFixesGetCursorImage(dpy) are accessed without first checking that xfc
is not NULL. This can result in the server sometimes crashing when
moving a Google Chrome window.

Fixes: 37c9461 ("Broken cursor bugfix for 64 bit systems (#49)")
Signed-off-by: Jonathan Liu <net147@gmail.com>
  • Loading branch information
net147 committed Mar 16, 2020
1 parent 799a6c9 commit 95a10ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cursor.c
Expand Up @@ -1311,7 +1311,7 @@ static int get_exact_cursor(int init) {

/* retrieve the cursor info + pixels from server: */
xfc = XFixesGetCursorImage(dpy);
{
if (xfc) {
/* 2017-07-09, Stephan Fuhrmann: This fixes an implementation flaw for 64 bit systems.
* The XFixesCursorImage structure says xfc->pixels is (unsigned long*) in the structure, but
* the protocol spec says it's 32 bit per pixel
Expand Down

0 comments on commit 95a10ab

Please sign in to comment.