Blame SOURCES/patch-2.7.6-avoid-invalid-memory-access-in-context-format-diffs.patch

0a6a4f
commit 15b158db3ae11cb835f2eb8d2eb48e09d1a4af48
0a6a4f
Author: Andreas Gruenbacher <agruen@gnu.org>
0a6a4f
Date:   Mon Jul 15 19:10:02 2019 +0200
0a6a4f
0a6a4f
    Avoid invalid memory access in context format diffs
0a6a4f
    
0a6a4f
    * src/pch.c (another_hunk): Avoid invalid memory access in context format
0a6a4f
    diffs.
0a6a4f
0a6a4f
diff --git a/src/pch.c b/src/pch.c
0a6a4f
index a500ad9..cb54e03 100644
0a6a4f
--- a/src/pch.c
0a6a4f
+++ b/src/pch.c
0a6a4f
@@ -1328,6 +1328,7 @@ another_hunk (enum diff difftype, bool rev)
0a6a4f
 		  ptrn_prefix_context = context;
0a6a4f
 		ptrn_suffix_context = context;
0a6a4f
 		if (repl_beginning
0a6a4f
+		    || p_end <= 0
0a6a4f
 		    || (p_end
0a6a4f
 			!= p_ptrn_lines + 1 + (p_Char[p_end - 1] == '\n')))
0a6a4f
 		  {