From 1b1d58d0f705bb73f7b1c6d1ff4b701ad2bbb790 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 10 Dec 2018 14:25:15 -0600 Subject: [PATCH 1/4] options: exit on a bad quoting regex, instead of crashing later The paragraph-jumping functions used the regex unverified... This fixes https://savannah.gnu.org/bugs/?55169. --- src/nano.c | 2 ++ src/text.c | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nano.c b/src/nano.c index 79b54508..abf02a9c 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2483,6 +2483,8 @@ int main(int argc, char **argv) quoteerr = charalloc(size); regerror(quoterc, "ereg, quoteerr, size); + + die(_("Bad quoting regex \"%s\": %s\n"), quotestr, quoteerr); } #endif /* ENABLE_JUSTIFY */ diff --git a/src/text.c b/src/text.c index 4592053b..53c0872e 100644 --- a/src/text.c +++ b/src/text.c @@ -2125,11 +2125,6 @@ bool find_paragraph(size_t *const quote, size_t *const par) filestruct *current_save; /* The line at the beginning of the paragraph we search for. */ - if (quoterc != 0) { - statusline(ALERT, _("Bad quote string %s: %s"), quotestr, quoteerr); - return FALSE; - } - /* If we're at the end of the last line of the file, it means that * there aren't any paragraphs left, so get out. */ if (openfile->current == openfile->filebot && openfile->current_x == -- 2.20.1