File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ int flb_parser_cri_do(struct flb_parser *parser,
56
56
time_key_len = strlen (time_key );
57
57
58
58
/* Time */
59
- token_end = strchr (in_buf , CRI_SPACE_DELIM );
59
+ token_end = memchr (in_buf , CRI_SPACE_DELIM , in_size );
60
60
61
61
/* after we find 'time' field (which is variable length),
62
62
* we also check that we have enough room for static size fields
@@ -112,7 +112,10 @@ int flb_parser_cri_do(struct flb_parser *parser,
112
112
token_end = token_end + 2 ; /* indicator + a space */
113
113
114
114
/* Log */
115
- end_of_line = strpbrk (token_end , "\r\n" );
115
+ end_of_line = memchr (token_end , '\n' , token_end - in_buf );
116
+ if (end_of_line == NULL ) {
117
+ end_of_line = memchr (token_end , '\r' , token_end - in_buf );
118
+ }
116
119
if (end_of_line == NULL || end_of_line - token_end > in_size ) {
117
120
end_of_line = (char * )in_buf + in_size ;
118
121
}
You can’t perform that action at this time.
0 commit comments