From 29ee09407413727007b5aa4290625ad57b16a106 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Sun, 29 Sep 2024 23:00:00 +0100 Subject: [PATCH] graphics/grOGL1.c Dereference of null pointer Looks like the code below requires mw!=NULL to do anything useful. So when mw==NULL we don't continue processing X11 Event. SonarCloud graphics/grOGL1.c:563 Dereference of null pointer https://sonarcloud.io/project/issues?open=AZJB16z6NGfDNup0Riss&id=dlmiles_magic --- graphics/grOGL1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphics/grOGL1.c b/graphics/grOGL1.c index ae18c04e..db1754a9 100644 --- a/graphics/grOGL1.c +++ b/graphics/grOGL1.c @@ -557,6 +557,8 @@ pipehandler() entry = HashLookOnly(&grOGLWindowTable, ExposeEvent->window); mw = (entry) ? (MagWindow *)HashGetValue(entry) : 0; + if(!mw) + break; screenRect.r_xbot = ExposeEvent->x; screenRect.r_xtop = ExposeEvent->x + ExposeEvent->width;