From Petr Ledvina <ledvinap@kae.zcu.cz>:
authorAndrew Cagney <cagney@redhat.com>
Sun, 13 Jan 2002 21:11:38 +0000 (21:11 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 13 Jan 2002 21:11:38 +0000 (21:11 +0000)
* signals.c (target_signal_to_name): Verify that SIG is within the
bounds of the signals array.

gdb/ChangeLog
gdb/signals.c

index 412d4012b8e16cf1e7fc71af78b625baf5b1cb75..d18a67787eb26062e649e7a2281419464d192037 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-13  Andrew Cagney  <ac131313@redhat.com>
+
+       From Petr Ledvina <ledvinap@kae.zcu.cz>:
+       * signals.c (target_signal_to_name): Verify that SIG is within the
+       bounds of the signals array.
+
 2002-01-13  Andrew Cagney  <ac131313@redhat.com>
 
        * MAINTAINERS: Remove arm-coff and arm-pe from target list.
index abbd7a56c926a0291dcb48a081b4dbd3718c33b6..cf0078d94fc76e1b66eb8cff3f72c6170f8141dd 100644 (file)
@@ -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.  */