12345678910111213141516171819202122232425262728 |
- 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/agrep/asearch.c
- +++ b/agrep/asearch.c
- @@ -254,7 +254,6 @@ Nextchar1file:
- {
- if(FILENAMEONLY && (NEW_FILE || !POST_FILTER)) {
- num_of_matched++;
- - free_buf(text, buffer);
-
- if (agrep_finalfp != NULL)
- fprintf(agrep_finalfp, "%s", CurrentFileName);
- --- a/agrep/sgrep.c
- +++ b/agrep/sgrep.c
- @@ -1079,7 +1079,9 @@ register CHARTYPE *text, *textend, *pat,
- 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;
|