diff options
author | szengel <szengel@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-08-17 17:33:40 +0000 |
---|---|---|
committer | szengel <szengel@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-08-17 17:33:40 +0000 |
commit | e95d61edaa55dd93eb9d665fee9ece1e1fc6c8c9 (patch) | |
tree | 1fab434bb5ac7440c990be2fcb8bdf592de37210 /src/regex/regex.c | |
parent | be7fbe5872c2e44d1dd5d6e5d97620ec36e7a6f1 (diff) |
Fixed eval test case and stack smashing protection
git-svn-id: https://gnunet.org/svn/gnunet@23290 140774ce-b5e7-0310-ab8b-a85725594a96
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 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; |