From e24152fbd06ba4c2b6cfd473751c7f00a676b9ae Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 18 Jul 2008 13:46:01 +1000 Subject: [PATCH] fixed a bug where we would look for a signal past the end of the signal arrays This could cause the events code to get into a loop chewing CPU --- lib/events/events_signal.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/events/events_signal.c b/lib/events/events_signal.c index 2f6d4993..128a9bc0 100644 --- a/lib/events/events_signal.c +++ b/lib/events/events_signal.c @@ -46,15 +46,15 @@ struct sigcounter { the poor design of signals means that this table must be static global */ static struct sig_state { - struct signal_event *sig_handlers[NUM_SIGNALS]; - struct sigaction *oldact[NUM_SIGNALS]; - struct sigcounter signal_count[NUM_SIGNALS]; + struct signal_event *sig_handlers[NUM_SIGNALS+1]; + struct sigaction *oldact[NUM_SIGNALS+1]; + struct sigcounter signal_count[NUM_SIGNALS+1]; struct sigcounter got_signal; int pipe_hack[2]; #ifdef SA_SIGINFO /* with SA_SIGINFO we get quite a lot of info per signal */ - siginfo_t *sig_info[NUM_SIGNALS]; - struct sigcounter sig_blocked[NUM_SIGNALS]; + siginfo_t *sig_info[NUM_SIGNALS+1]; + struct sigcounter sig_blocked[NUM_SIGNALS+1]; #endif } *sig_state; -- 2.34.1