From 60fe6427da0131438086ba4da63b67a4aa32c035 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Sun, 29 Sep 2024 23:00:00 +0100 Subject: [PATCH] graphics/grX11su1.c: Dereference of null pointer Looks like the code below requires w!=NULL to do anything useful. So when w==NULL we don't continue processing X11 Event. SonarCloud graphics/grX11su1.c:895 Dereference of null pointer https://sonarcloud.io/project/issues?open=AZJB163RNGfDNup0Ri4p&id=dlmiles_magic --- graphics/grX11su1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphics/grX11su1.c b/graphics/grX11su1.c index 560ec71e..181143ba 100644 --- a/graphics/grX11su1.c +++ b/graphics/grX11su1.c @@ -890,6 +890,8 @@ grX11Stdin() entry = HashLookOnly(&grX11WindowTable, VisEvent->window); w = (entry)?(MagWindow *)HashGetValue(entry):0; + if(!w) + break; switch(VisEvent->state) {