From 0a34c580e0d2e611a4216358dffb95550650dcd7 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Tue, 18 May 2021 14:34:44 +0000
Subject: [PATCH] (extfs.c) fix dereference before null check
Fix dereference before null check
Found by Coverity
Coverity id #110818
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/editor/editcmd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
index 59ff0e47d..b421c2f36 100644
a
|
b
|
edit_do_search (WEdit * edit) |
995 | 995 | && !edit_search_options.backwards) |
996 | 996 | edit->search_start++; |
997 | 997 | |
998 | | if (editcmd_find (&esm, &len)) |
| 998 | if (edit->search != NULL && editcmd_find (&esm, &len)) |
999 | 999 | { |
1000 | 1000 | edit->found_start = edit->search_start = edit->search->normal_offset; |
1001 | 1001 | edit->found_len = len; |
… |
… |
edit_do_search (WEdit * edit) |
1010 | 1010 | else |
1011 | 1011 | { |
1012 | 1012 | edit->search_start = edit->buffer.curs1; |
1013 | | edit_show_search_error (edit, _("Search")); |
| 1013 | if (edit->search != NULL) |
| 1014 | edit_show_search_error (edit, _("Search")); |
1014 | 1015 | } |
1015 | 1016 | } |
1016 | 1017 | |