[PATCH]libXt-1.0.8/src/TMparse.c: avoid possible NULL reference

walter harms wharms at bfs.de
Fri Oct 22 10:36:07 PDT 2010


*Event could become NULL add check

re,
 wh

Signed-off-by: wharms at bfs.de


--- libXt-1.0.8/src/TMparse.c.org	2010-10-20 22:04:30.000000000 +0200
+++ libXt-1.0.8/src/TMparse.c	2010-10-20 22:04:44.000000000 +0200
@@ -1291,10 +1291,15 @@
 	*event = timerEventRec;

     }
-
+    /*
+      if reps==0 -> lastDownEvent == NULL
+    */
     event->next = lastDownEvent;
     *eventP = event;
-    *actionsP = &lastDownEvent->actions;
+    if (lastDownEvent)
+      *actionsP = &lastDownEvent->actions;
+    else
+      *actionsP = NULL ;
 }

 static void RepeatUp(
@@ -1398,10 +1403,15 @@
 	*event = *downEvent;

 	}
-
+    /*
+      if reps==0 -> lastUpEvent == NULL
+    */
     event->next = lastUpEvent;
     *eventP = event;
-    *actionsP = &lastUpEvent->actions;
+    if (lastUpEvent)
+      *actionsP = &lastUpEvent->actions;
+    else
+      *actionsP = NULL ;
 }

 static void RepeatOther(


More information about the xorg-devel mailing list