summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2017-03-12 14:21:38 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2017-09-22 18:45:59 +0200
commitdf4d01e6aa957ec8eb2814832de2f78ca42ee238 (patch)
tree371e316a4c3b6aaa8682526c6d7b3cdf2929d70f /hw
parente23000d83f8dbab4effd9f344f3d776634a1d56e (diff)
dmx: Fix null pointer dereference
A null pointer dereference can occur in dmxSync, because TimerForce does not handle a null pointer. dmxSyncTimer is set to NULL a few lines above on a certain condition, which happened on my machine. The explicit NULL check allowed me to start Xdmx again without a segmentation fault. Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit 21eda7464d0e13ac6558edaf6531c3d3251e05df)
Diffstat (limited to 'hw')
-rw-r--r--hw/dmx/dmxsync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/dmx/dmxsync.c b/hw/dmx/dmxsync.c
index 1bc242343..b55c9ddf3 100644
--- a/hw/dmx/dmxsync.c
+++ b/hw/dmx/dmxsync.c
@@ -182,7 +182,7 @@ dmxSync(DMXScreenInfo * dmxScreen, Bool now)
/* Do sync or set time for later */
if (now || !dmxScreen) {
- if (!TimerForce(dmxSyncTimer))
+ if (dmxSyncTimer == NULL || !TimerForce(dmxSyncTimer))
dmxSyncCallback(NULL, 0, NULL);
/* At this point, dmxSyncPending == 0 because
* dmxSyncCallback must have been called. */