From 8801de2399e0c28f3c9acbc717d79fa374f1979f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Thu, 14 May 2015 13:07:56 -0400 Subject: [PATCH] Protect "move position mouse" against a NULL access. This could happen if two outputs are set up to have a gap in between them and the mouse cursor being in said gap when the command is triggered. --- src/floating.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/floating.c b/src/floating.c index d44334fe..a2843535 100644 --- a/src/floating.c +++ b/src/floating.c @@ -440,6 +440,10 @@ void floating_move_to_pointer(Con *con) { } Output *output = get_output_containing(reply->root_x, reply->root_y); + if (output == NULL) { + ELOG("The pointer is not on any output, cannot move the container here."); + return; + } /* Determine where to put the window. */ int32_t x = reply->root_x - con->rect.width / 2; -- 2.39.5