Date: Sat, 21 Jan 2012 21:54:31 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r230439 - stable/9/bin/sh Message-ID: <201201212154.q0LLsVc8011121@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Sat Jan 21 21:54:31 2012 New Revision: 230439 URL: http://svn.freebsd.org/changeset/base/230439 Log: MFC r230117: sh: Fix out of bounds array access when trap is used with an invalid signal. Modified: stable/9/bin/sh/trap.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/trap.c ============================================================================== --- stable/9/bin/sh/trap.c Sat Jan 21 21:12:53 2012 (r230438) +++ stable/9/bin/sh/trap.c Sat Jan 21 21:54:31 2012 (r230439) @@ -191,10 +191,11 @@ trapcmd(int argc, char **argv) argv++; } } - while (*argv) { + for (; *argv; argv++) { if ((signo = sigstring_to_signum(*argv)) == -1) { warning("bad signal %s", *argv); errors = 1; + continue; } INTOFF; if (action) @@ -205,7 +206,6 @@ trapcmd(int argc, char **argv) if (signo != 0) setsignal(signo); INTON; - argv++; } return errors; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201212154.q0LLsVc8011121>