(mc_search__g_regex_match_full_safe): don't use negative string length.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
2e078ff774
Коммит
37de8e6253
@ -277,6 +277,9 @@ mc_search__g_regex_match_full_safe (const GRegex * regex,
|
|||||||
char *string_safe, *p, *end;
|
char *string_safe, *p, *end;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
|
if (string_len < 0)
|
||||||
|
string_len = strlen (string);
|
||||||
|
|
||||||
if ((g_regex_get_compile_flags (regex) & G_REGEX_RAW)
|
if ((g_regex_get_compile_flags (regex) & G_REGEX_RAW)
|
||||||
|| g_utf8_validate (string, string_len, NULL))
|
|| g_utf8_validate (string, string_len, NULL))
|
||||||
{
|
{
|
||||||
@ -284,11 +287,6 @@ mc_search__g_regex_match_full_safe (const GRegex * regex,
|
|||||||
match_info, error);
|
match_info, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string_len < 0)
|
|
||||||
{
|
|
||||||
string_len = strlen (string);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Correctly handle embedded NULs while copying */
|
/* Correctly handle embedded NULs while copying */
|
||||||
p = string_safe = g_malloc (string_len);
|
p = string_safe = g_malloc (string_len);
|
||||||
memcpy (string_safe, string, string_len);
|
memcpy (string_safe, string, string_len);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user