mirror of
https://github.com/tmux/tmux.git
synced 2026-04-16 03:56:28 +00:00
Handle empty regular expression in substitution, found by ossfuzz.
This commit is contained in:
2
regsub.c
2
regsub.c
@@ -68,6 +68,8 @@ regsub(const char *pattern, const char *with, const char *text, int flags)
|
|||||||
|
|
||||||
if (*text == '\0')
|
if (*text == '\0')
|
||||||
return (xstrdup(""));
|
return (xstrdup(""));
|
||||||
|
if (*pattern == '\0')
|
||||||
|
return (xstrdup(text));
|
||||||
if (regcomp(&r, pattern, flags) != 0)
|
if (regcomp(&r, pattern, flags) != 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user