From owner-svn-src-stable@FreeBSD.ORG Sun Feb 17 19:50:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 313C03F3; Sun, 17 Feb 2013 19:50:00 +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 22F4267F; Sun, 17 Feb 2013 19:50:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1HJo0Fg051978; Sun, 17 Feb 2013 19:50:00 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1HJo0RK051965; Sun, 17 Feb 2013 19:50:00 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201302171950.r1HJo0RK051965@svn.freebsd.org> From: Mark Johnston Date: Sun, 17 Feb 2013 19:49:59 +0000 (UTC) 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 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2013 19:50:00 -0000 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; \