Running past the end of the chain would cause a SEGV.

Signed-off-by: Egbert Eich <[email protected]>
---
 process.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/process.c b/process.c
index 166b769..0f719ce 100644
--- a/process.c
+++ b/process.c
@@ -1280,8 +1280,11 @@ remove_entry(const char *inputfilename, int lineno, 
Xauth *auth, char *data)
     /*
      * unlink the auth we were asked to
      */
-    while (!eq_auth((list = *listp)->auth, auth))
+    while (!eq_auth((list = *listp)->auth, auth)) {
        listp = &list->next;
+       if (!*listp)
+           return 0;
+    }
     *listp = list->next;
     XauDisposeAuth (list->auth);                    /* free the auth */
     free (list);                                   /* free the link */
-- 
1.8.1.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to