mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
(mc_search__g_regex_match_full_safe): don't use negative string length.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
2e078ff774
commit
37de8e6253
@ -277,6 +277,9 @@ mc_search__g_regex_match_full_safe (const GRegex * regex,
|
||||
char *string_safe, *p, *end;
|
||||
gboolean ret;
|
||||
|
||||
if (string_len < 0)
|
||||
string_len = strlen (string);
|
||||
|
||||
if ((g_regex_get_compile_flags (regex) & G_REGEX_RAW)
|
||||
|| g_utf8_validate (string, string_len, NULL))
|
||||
{
|
||||
@ -284,11 +287,6 @@ mc_search__g_regex_match_full_safe (const GRegex * regex,
|
||||
match_info, error);
|
||||
}
|
||||
|
||||
if (string_len < 0)
|
||||
{
|
||||
string_len = strlen (string);
|
||||
}
|
||||
|
||||
/* Correctly handle embedded NULs while copying */
|
||||
p = string_safe = g_malloc (string_len);
|
||||
memcpy (string_safe, string, string_len);
|
||||
|
Loading…
Reference in New Issue
Block a user