diff options
Diffstat (limited to 'src/regex/regex.c')
-rw-r--r-- | src/regex/regex.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/regex/regex.c b/src/regex/regex.c index 694386e9a..79d94ea03 100644 --- a/src/regex/regex.c +++ b/src/regex/regex.c | |||
@@ -630,7 +630,8 @@ GNUNET_REGEX_automaton_traverse (const struct GNUNET_REGEX_Automaton *a, | |||
630 | if (NULL == a || 0 == a->state_count) | 630 | if (NULL == a || 0 == a->state_count) |
631 | return; | 631 | return; |
632 | 632 | ||
633 | for (count = 0, s = a->states_head; NULL != s; s = s->next, count++) | 633 | for (count = 0, s = a->states_head; NULL != s && count < a->state_count; |
634 | s = s->next, count++) | ||
634 | { | 635 | { |
635 | s->traversal_id = count; | 636 | s->traversal_id = count; |
636 | marks[s->traversal_id] = GNUNET_NO; | 637 | marks[s->traversal_id] = GNUNET_NO; |
@@ -750,7 +751,7 @@ GNUNET_REGEX_add_multi_strides_to_dfa (struct GNUNET_REGEX_Context *regex_ctx, | |||
750 | struct GNUNET_REGEX_Automaton *dfa, | 751 | struct GNUNET_REGEX_Automaton *dfa, |
751 | const unsigned int stride_len) | 752 | const unsigned int stride_len) |
752 | { | 753 | { |
753 | struct GNUNET_REGEX_Strided_Context ctx = { stride_len, NULL, NULL}; | 754 | struct GNUNET_REGEX_Strided_Context ctx = { stride_len, NULL, NULL }; |
754 | struct GNUNET_REGEX_Transition *t; | 755 | struct GNUNET_REGEX_Transition *t; |
755 | struct GNUNET_REGEX_Transition *t_next; | 756 | struct GNUNET_REGEX_Transition *t_next; |
756 | 757 | ||