mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 01:03:14 +02:00
api: fix infinite loop in function string_replace when the search string is empty
This commit is contained in:
@@ -1965,6 +1965,9 @@ string_replace (const char *string, const char *search, const char *replace)
|
||||
if (!string || !search || !replace)
|
||||
return NULL;
|
||||
|
||||
if (!search[0])
|
||||
return strdup (string);
|
||||
|
||||
length1 = strlen (search);
|
||||
length2 = strlen (replace);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user