summaryrefslogtreecommitdiff
path: root/deb.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-05-09 18:49:25 -0400
committerTony Cook <tony@develop-help.com>2014-05-29 16:43:42 +1000
commit00b25eff1415ab27d5829f30fea1fecd57a7934e (patch)
tree409bd6e05cb1beee08e22579549de91a6aa4360f /deb.c
parenta2d8379b96447607acb2221e284e1f5436dd64d8 (diff)
downloadperl-00b25eff1415ab27d5829f30fea1fecd57a7934e.tar.gz
si_names access one past the end.
Fix for Coverity perl5 CID 45359.
Diffstat (limited to 'deb.c')
-rw-r--r--deb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/deb.c b/deb.c
index bccfc180e7..d16103eb1e 100644
--- a/deb.c
+++ b/deb.c
@@ -217,7 +217,9 @@ Perl_deb_stack_all(pTHX)
for (;;)
{
const size_t si_name_ix = si->si_type+1; /* -1 is a valid index */
- const char * const si_name = (si_name_ix >= sizeof(si_names)) ? "????" : si_names[si_name_ix];
+ const char * const si_name =
+ si_name_ix < C_ARRAY_LENGTH(si_names) ?
+ si_names[si_name_ix] : "????";
I32 ix;
PerlIO_printf(Perl_debug_log, "STACK %"IVdf": %s\n",
(IV)si_ix, si_name);