[Bro-Dev] #8: Handling optional fields

Bro Tracker bro at tracker.bro-ids.org
Fri Dec 16 18:48:41 PST 2011


#8: Handling optional fields
-----------------------+----------------------
  Reporter:  matthias  |      Owner:  kreibich
      Type:  Task      |     Status:  accepted
  Priority:  Normal    |  Milestone:
 Component:  Broccoli  |    Version:  1.5.2
Resolution:            |   Keywords:
-----------------------+----------------------

Comment (by matthias):

 This may fix the issue, but I haven't tested it (yet).

 {{{
 diff --git a/src/bro_val.c b/src/bro_val.c
 index 6efdadf..f163d0b 100644
 --- a/src/bro_val.c
 +++ b/src/bro_val.c
 @@ -403,6 +403,9 @@ __bro_val_get_data(BroVal *val, int *type, void
 **data)
    if (! val || ! data)
      return FALSE;

 +  if (val->val_type == NULL)
 +    return FALSE;
 +
    if (! val->get_data)
      return FALSE;
  }}}

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/8#comment:5>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list