]> git.saurik.com Git - apple/libc.git/blobdiff - regex/TRE/lib/tre-parse.c
Libc-1439.100.3.tar.gz
[apple/libc.git] / regex / TRE / lib / tre-parse.c
index ad09c2620dcf1c3b150aafb8f5559a160d593f63..fa0b34a98c3884535259a105740e5a74353dfc66 100644 (file)
@@ -107,7 +107,7 @@ tre_expand_macro(const tre_char_t *regex, const tre_char_t *regex_end,
 }
 
 static reg_errcode_t
-tre_new_item(tre_mem_t mem, int type, int val, int *max_i,
+tre_new_item(tre_mem_t __unused mem, int type, int val, int *max_i,
         tre_bracket_match_list_t **items)
 {
   reg_errcode_t status = REG_OK;
@@ -717,7 +717,7 @@ static const char *bracket_match_type_str[] = {
 static reg_errcode_t
 tre_parse_bracket(tre_parse_ctx_t *ctx, tre_ast_node_t **result)
 {
-  tre_ast_node_t *node;
+  tre_ast_node_t *node = NULL;
   reg_errcode_t status = REG_OK;
   tre_bracket_match_list_t *items;
   int max_i = 32;
@@ -2016,6 +2016,8 @@ tre_parse(tre_parse_ctx_t *ctx)
                        ctx->re++;
                        while (ctx->re_end - ctx->re >= 0)
                          {
+                           if (i == sizeof(tmp))
+                               return REG_EBRACE;
                            if (ctx->re[0] == CHAR_RBRACE)
                              break;
                            if (tre_isxdigit_l(ctx->re[0], ctx->loc))