aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex/regex.c')
-rw-r--r--src/regex/regex.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/regex/regex.c b/src/regex/regex.c
index 694386e9aa..79d94ea036 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,
if (NULL == a || 0 == a->state_count)
return;
- for (count = 0, s = a->states_head; NULL != s; s = s->next, count++)
+ for (count = 0, s = a->states_head; NULL != s && count < a->state_count;
+ s = s->next, count++)
{
s->traversal_id = count;
marks[s->traversal_id] = GNUNET_NO;
@@ -750,7 +751,7 @@ GNUNET_REGEX_add_multi_strides_to_dfa (struct GNUNET_REGEX_Context *regex_ctx,
struct GNUNET_REGEX_Automaton *dfa,
const unsigned int stride_len)
{
- struct GNUNET_REGEX_Strided_Context ctx = { stride_len, NULL, NULL};
+ struct GNUNET_REGEX_Strided_Context ctx = { stride_len, NULL, NULL };
struct GNUNET_REGEX_Transition *t;
struct GNUNET_REGEX_Transition *t_next;