From 89c49e7acbffd8264cee697abbcaf0bb58bf065c Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 13 Jan 2002 21:11:38 +0000 Subject: [PATCH] From Petr Ledvina : * signals.c (target_signal_to_name): Verify that SIG is within the bounds of the signals array. --- gdb/ChangeLog | 6 ++++++ gdb/signals.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 412d4012b8e..d18a67787eb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-01-13 Andrew Cagney + + From Petr Ledvina : + * signals.c (target_signal_to_name): Verify that SIG is within the + bounds of the signals array. + 2002-01-13 Andrew Cagney * MAINTAINERS: Remove arm-coff and arm-pe from target list. diff --git a/gdb/signals.c b/gdb/signals.c index abbd7a56c92..cf0078d94fc 100644 --- a/gdb/signals.c +++ b/gdb/signals.c @@ -214,7 +214,10 @@ target_signal_to_name (enum target_signal sig) /* I think the code which prints this will always print it along with the string, so no need to be verbose. */ return "?"; - return signals[sig].name; + else if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)) + return signals[sig].name; + else + return signals[sig].name; } /* Given a name, return its signal. */ -- 2.30.2