1
0
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:
Sébastien Helleu
2026-06-03 21:15:16 +02:00
parent 377b6da43d
commit d15ce789a0
3 changed files with 6 additions and 0 deletions
+3
View File
@@ -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);