Package: agrep / 4.17-9.1

fix-double-free.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Author: Stefan Weil <sw@weilnetz.de>
Description: Fix crash caused by double free
Bug-Debian: https://bugs.debian.org/869220
Forwarded: https://github.com/Wikinaut/agrep/pull/13

--- a/asearch.c
+++ b/asearch.c
@@ -254,7 +254,6 @@
 					{ 
 						if(FILENAMEONLY && (NEW_FILE || !POST_FILTER)) {
 							num_of_matched++;
-							free_buf(text, buffer);
 
 							if (agrep_finalfp != NULL)
 								fprintf(agrep_finalfp, "%s", CurrentFileName);
--- a/sgrep.c
+++ b/sgrep.c
@@ -1079,7 +1079,9 @@
 	CHARTYPE *lastout = text;
 	int newlen;
 
-	Candidate[0][0] = Candidate[0][1] = 0; 
+	Candidate[0][0] = 0;
+	Candidate[0][1] = 0;
+	Candidate[1][0] = 0;
 	d1 = shift_1;
 	cdx = 0;
 	if(m < 3) r1 = m;