mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Ticket #3703: fix potential NULL dereference.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
1aefd27a2a
commit
eec71bccff
@ -346,12 +346,12 @@ mc_search_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str
|
|||||||
{
|
{
|
||||||
GString *ret;
|
GString *ret;
|
||||||
|
|
||||||
|
if (replace_str == NULL || replace_str->len == 0)
|
||||||
|
return g_string_new ("");
|
||||||
|
|
||||||
if (lc_mc_search == NULL)
|
if (lc_mc_search == NULL)
|
||||||
return g_string_new_len (replace_str->str, replace_str->len);
|
return g_string_new_len (replace_str->str, replace_str->len);
|
||||||
|
|
||||||
if (replace_str == NULL || replace_str->str == NULL || replace_str->len == 0)
|
|
||||||
return g_string_new ("");
|
|
||||||
|
|
||||||
switch (lc_mc_search->search_type)
|
switch (lc_mc_search->search_type)
|
||||||
{
|
{
|
||||||
case MC_SEARCH_T_REGEX:
|
case MC_SEARCH_T_REGEX:
|
||||||
|
Loading…
Reference in New Issue
Block a user