Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/cvs/lib From otto@OpenBSD:



details:   https://anonhg.NetBSD.org/src/rev/aebe7a0d02fd
branches:  trunk
changeset: 569852:aebe7a0d02fd
user:      wiz <wiz%NetBSD.org@localhost>
date:      Thu Sep 09 22:23:29 2004 +0000

description:
>From otto@OpenBSD:
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'd by christos.

diffstat:

 gnu/dist/cvs/lib/sighandle.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r e0b4a886ada3 -r aebe7a0d02fd gnu/dist/cvs/lib/sighandle.c
--- a/gnu/dist/cvs/lib/sighandle.c      Thu Sep 09 22:03:21 2004 +0000
+++ b/gnu/dist/cvs/lib/sighandle.c      Thu Sep 09 22:23:29 2004 +0000
@@ -155,8 +155,10 @@
        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;



Home | Main Index | Thread Index | Old Index