diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-01-13 19:51:45 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-01-13 19:51:45 +0000 |
commit | 5347a83a84825250010e9645c385ada050dea20e (patch) | |
tree | cb5afa9921560509759870c6fe81ca7aa174986c /gnu/usr.bin | |
parent | 81f39406db7bf80f216fadda466ff7406eb84123 (diff) |
Do not evaluate this->next after calling the handler; the handler may
have clobbered it. Resolves core dumps of cvs server on user ^C.
ok millert@ deraadt@
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/cvs/lib/sighandle.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/usr.bin/cvs/lib/sighandle.c b/gnu/usr.bin/cvs/lib/sighandle.c index f595dd24912..45b7477d014 100644 --- a/gnu/usr.bin/cvs/lib/sighandle.c +++ b/gnu/usr.bin/cvs/lib/sighandle.c @@ -155,8 +155,10 @@ int sig; this = SIG_handlers[sig]; while (this != (struct SIG_hlist *) NULL) { - (*this->handler)(sig); + /* handler may free this (and thus clobber this->next) */ + struct SIG_hlist *current = this; this = this->next; + (*current->handler)(sig); } return; |