mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Merge branch '4222_search_segfault'
* 4222_search_segfault: Ticket #4222: fix segfault in search.
This commit is contained in:
commit
9436bd1fa4
@ -288,8 +288,9 @@ mc_search__g_regex_match_full_safe (const GRegex * regex,
|
||||
}
|
||||
|
||||
/* Correctly handle embedded NULs while copying */
|
||||
p = string_safe = g_malloc (string_len);
|
||||
p = string_safe = g_malloc (string_len + 1);
|
||||
memcpy (string_safe, string, string_len);
|
||||
string_safe[string_len] = '\0';
|
||||
end = p + string_len;
|
||||
|
||||
while (p < end)
|
||||
|
Loading…
Reference in New Issue
Block a user