Skip to content

Commit a915534

Browse files
cosmo0920edsiper
authored andcommitted
regex: Fix regex literal crash
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent 8e17223 commit a915534

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/flb_regex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int str_to_regex(const char *pattern, OnigRegex *reg)
129129

130130
option = check_option(start, end, &new_end);
131131

132-
if (pattern[0] == '/' && pattern[len - 1] == '/') {
132+
if (len > 1 && pattern[0] == '/' && pattern[len - 1] == '/') {
133133
start++;
134134
end--;
135135
}

0 commit comments

Comments
 (0)