From 4ffc344ddf6246bf8d19c94c58af0853ae6768a7 Mon Sep 17 00:00:00 2001 From: ph10 Date: Mon, 29 Jan 2018 14:45:51 +0000 Subject: Fix out-of-bounds read for partial matching of /./ against an empty string when the newline type is CRLF. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1723 2f5784b3-3f2a-0410-8824-cb99058d5e15 --- pcre_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pcre_exec.c') diff --git a/pcre_exec.c b/pcre_exec.c index 1a9bdd5..1993cb3 100644 --- a/pcre_exec.c +++ b/pcre_exec.c @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2014 University of Cambridge + Copyright (c) 1997-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -2305,7 +2305,7 @@ for (;;) case OP_ANY: if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); if (md->partial != 0 && - eptr + 1 >= md->end_subject && + eptr == md->end_subject - 1 && NLBLOCK->nltype == NLTYPE_FIXED && NLBLOCK->nllen == 2 && UCHAR21TEST(eptr) == NLBLOCK->nl[0]) -- cgit v1.2.1