diff options
author | Egbert Eich <eich@freedesktop.org> | 2013-08-14 17:07:35 +0200 |
---|---|---|
committer | Dr. Tilmann Bubeck <t.bubeck@reinform.de> | 2013-09-23 22:32:13 +0200 |
commit | eee471e446405350c02c221f044a70669dac48a2 (patch) | |
tree | 1c5e0fe5e5cf85f5f0ff419db6a3c4ffcced9aa3 /process.c | |
parent | 6dda11c17f2fdc47d43f269dccee98ec66cc8c4b (diff) | |
download | xorg-app-xauth-eee471e446405350c02c221f044a70669dac48a2.tar.gz |
Don't crash when running past the end of the chain
Running past the end of the chain would cause a SEGV.
Signed-off-by: Egbert Eich <eich@freedesktop.org>
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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)) - listp = &list->next; + 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 */ |