sh: null check signame list since sig 0 is not valid

Change-Id: I1b293246ea1d822e098d0581830500e93633a879
Signed-off-by: Dima Zavin <dima@android.com>
This commit is contained in:
Dima Zavin 2010-12-09 14:20:09 -08:00
parent 90493929b2
commit 8d758271d4

View file

@ -100,7 +100,7 @@ signame_to_signum(const char *p)
p += 3;
for (i = 0; i < NSIG; ++i)
if (strcasecmp (p, sys_signame[i]) == 0)
if (sys_signame[i] && (strcasecmp (p, sys_signame[i]) == 0))
return i;
return -1;
}