Date: Sun, 17 Feb 2013 19:49:59 +0000 (UTC) From: Mark Johnston <markj@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: r246920 - stable/9/usr.bin/grep/regex Message-ID: <201302171950.r1HJo0RK051965@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Sun Feb 17 19:49:59 2013 New Revision: 246920 URL: http://svnweb.freebsd.org/changeset/base/246920 Log: MFC r245075: Fix a segfault when bsdgrep -i is given an empty pattern string. Approved by: emaste (co-mentor) Modified: stable/9/usr.bin/grep/regex/tre-fastmatch.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- stable/9/usr.bin/grep/regex/tre-fastmatch.c Sun Feb 17 19:49:29 2013 (r246919) +++ stable/9/usr.bin/grep/regex/tre-fastmatch.c Sun Feb 17 19:49:59 2013 (r246920) @@ -468,7 +468,7 @@ static int fastcmp(const fastmatch_t *fg fg->nosub = (cflags & REG_NOSUB); \ \ /* Cannot handle REG_ICASE with MB string */ \ - if (fg->icase && (TRE_MB_CUR_MAX > 1)) \ + if (fg->icase && (TRE_MB_CUR_MAX > 1) && n > 0) \ { \ DPRINT(("Cannot use fast matcher for MBS with REG_ICASE\n")); \ return REG_BADPAT; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302171950.r1HJo0RK051965>