Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2011 13:22:36 +0000 (UTC)
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r225715 - user/gabor/grep/trunk/regex
Message-ID:  <201109211322.p8LDMa0H077356@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gabor
Date: Wed Sep 21 13:22:36 2011
New Revision: 225715
URL: http://svn.freebsd.org/changeset/base/225715

Log:
  - Do not allow trailing escape

Modified:
  user/gabor/grep/trunk/regex/tre-fastmatch.c

Modified: user/gabor/grep/trunk/regex/tre-fastmatch.c
==============================================================================
--- user/gabor/grep/trunk/regex/tre-fastmatch.c	Wed Sep 21 13:19:45 2011	(r225714)
+++ user/gabor/grep/trunk/regex/tre-fastmatch.c	Wed Sep 21 13:22:36 2011	(r225715)
@@ -599,6 +599,8 @@ tre_compile_fast(fastmatch_t *fg, const 
 	  case TRE_CHAR('\\'):
 	    if (escaped)
 	      STORE_CHAR;
+	    else if (i == n - 1)
+	      goto badpat;
 	    else
 	      escaped = true;
 	    continue;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109211322.p8LDMa0H077356>