From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 22:04:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC938925; Sat, 5 Jan 2013 22:04:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDC7E843; Sat, 5 Jan 2013 22:04:40 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05M4en0080199; Sat, 5 Jan 2013 22:04:40 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05M4euk080198; Sat, 5 Jan 2013 22:04:40 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301052204.r05M4euk080198@svn.freebsd.org> From: Mark Johnston Date: Sat, 5 Jan 2013 22:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245075 - head/usr.bin/grep/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2013 22:04:40 -0000 Author: markj Date: Sat Jan 5 22:04:40 2013 New Revision: 245075 URL: http://svnweb.freebsd.org/changeset/base/245075 Log: Fix a segfault when bsdgrep -i is given an empty pattern string. PR: bin/172865 Reviewed by: gabor Approved by: emaste (co-mentor) MFC after: 1 week Modified: head/usr.bin/grep/regex/tre-fastmatch.c Modified: head/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- head/usr.bin/grep/regex/tre-fastmatch.c Sat Jan 5 21:52:38 2013 (r245074) +++ head/usr.bin/grep/regex/tre-fastmatch.c Sat Jan 5 22:04:40 2013 (r245075) @@ -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; \