From 22a7ef782d219bbd16547610d11d98499e0ad759 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 28 May 2021 09:33:32 +0300 Subject: [PATCH] (edit_do_search): search descriptor should not be NULL. Fix of Coverity id #110818. Signed-off-by: Andrew Borodin --- src/editor/editsearch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/editor/editsearch.c b/src/editor/editsearch.c index 329ce009a..028fc23e0 100644 --- a/src/editor/editsearch.c +++ b/src/editor/editsearch.c @@ -25,6 +25,8 @@ #include +#include + #include "lib/global.h" #include "lib/search.h" #include "lib/mcconfig.h" /* mc_config_history_get */ @@ -575,8 +577,8 @@ edit_do_search (WEdit * edit) edit_search_status_msg_t esm; gsize len = 0; - if (edit->search == NULL) - edit->search_start = edit->buffer.curs1; + /* This shouldn't happen */ + assert (edit->search != NULL); edit_push_undo_action (edit, KEY_PRESS + edit->start_display);