]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-signals: Fix lib_signals_set_expected().
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 27 May 2020 10:16:25 +0000 (12:16 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 27 May 2020 13:46:51 +0000 (13:46 +0000)
The function made no sense at all.

Problem found by Coverity.

src/lib/lib-signals.c

index f116052956d26487d5a9572d34ed32732369f237..078fd005e3108965d59d60275dbb7bc5b414332a 100644 (file)
@@ -513,8 +513,8 @@ void lib_signals_set_expected(int signo, bool expected,
 {
        struct signal_handler *h;
 
-       for (signo = 0; signo < MAX_SIGNAL_VALUE; signo++) {
-               for (h = signal_handlers[signo]; h != NULL; h = h->next) {
+       for (h = signal_handlers[signo]; h != NULL; h = h->next) {
+               if (h->handler == handler && h->context == context) {
                        if (h->expected == expected)
                                return;
                        h->expected = expected;