diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2005-10-01 15:19:36 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2005-10-01 15:19:36 +0000 |
commit | 154d8ae08733a83bfe0a314d0e4492697eebb143 (patch) | |
tree | 0486f542a03b4adb5b4246bfd2e3e9f3f750da79 /epan/tvbparse.c | |
parent | 54695fec80f9bc99f63344b49c6cc589b8d4f138 (diff) | |
download | wireshark-154d8ae08733a83bfe0a314d0e4492697eebb143.tar.gz wireshark-154d8ae08733a83bfe0a314d0e4492697eebb143.tar.bz2 wireshark-154d8ae08733a83bfe0a314d0e4492697eebb143.zip |
one step further...
TPG now uses the ignore feature of tvbparse
named sub_rules can have cardinality
epan/tvbparse.c:
do not crash on zero cardinality
svn path=/trunk/; revision=16065
Diffstat (limited to 'epan/tvbparse.c')
-rw-r--r-- | epan/tvbparse.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/tvbparse.c b/epan/tvbparse.c index f6950e75fa..78dbffbde2 100644 --- a/epan/tvbparse.c +++ b/epan/tvbparse.c @@ -663,7 +663,7 @@ tvbparse_elem_t* tvbparse_get(tvbparse_t* tt, tvbparse_wanted_t* w = g_ptr_array_index(wanted->elems,0); if ( wanted->min == 0 ) { - new_tok(tt,wanted->id,tt->offset,0,wanted); + tok = new_tok(tt,wanted->id,tt->offset,0,wanted); } while (got_so_far < wanted->max) { @@ -672,8 +672,12 @@ tvbparse_elem_t* tvbparse_get(tvbparse_t* tt, if(new) { if (tok) { tok->len = (new->offset - tok->offset) + new->len; - tok->sub->last->next = new; - tok->sub->last = new; + if (tok->sub) { + tok->sub->last->next = new; + tok->sub->last = new; + } else { + tok->sub = new; + } } else { tok = new_tok(tt, wanted->id, new->offset, new->len, wanted); tok->sub = new; |