From 4b6090ded3f772b79f573e0a9410161a3ddb58bc Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 17 Aug 2020 10:05:25 +0200 Subject: [PATCH] replacing: do not try to wipe nonexistent multidata, to avoid crashing This fixes https://savannah.gnu.org/bugs/?58970. Reported-by: Matteo Raso Bug existed since version 5.0, commit 569d0056. --- src/search.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/search.c b/src/search.c index d9e12205..adf13294 100644 --- a/src/search.c +++ b/src/search.c @@ -493,8 +493,9 @@ char *replace_line(const char *needle) void wipe_and_recalculate_colorinfo(void) { for (linestruct *line = openfile->filetop; line != NULL; line = line->next) - for (short index = 0; index < openfile->syntax->nmultis; index++) - line->multidata[index] = -1; + if (line->multidata) + for (short index = 0; index < openfile->syntax->nmultis; index++) + line->multidata[index] = -1; precalc_multicolorinfo(); }