[Bro-Dev] #932: Assigning an uninitialized variable to a vector stops execution of bro script

Bro Tracker bro at tracker.bro-ids.org
Fri Jan 18 08:32:45 PST 2013


#932: Assigning an uninitialized variable to a vector stops execution of bro
script
----------------------------+------------------------
  Reporter:  amannb         |      Owner:
      Type:  Merge Request  |     Status:  new
  Priority:  Normal         |  Milestone:  Bro2.2
 Component:  Bro            |    Version:  git/master
Resolution:                 |   Keywords:
----------------------------+------------------------
Changes (by jsiwek):

 * type:  Problem => Merge Request


Comment:

 This was an interesting bug.  The difference between bare-mode and non-
 bare-mode had to do with an unexpected interaction between `bro_init`
 handlers...

 commit [0a69b87f03b18f6c5b4e6952912b5390c9e698b1/bro]:

 {{{
     Fix uninitialized locals in event/hook handlers from having a value.

     Since values for local variables are referenced by offset within a
 Frame
     (not by identifier name), and event/hook handler bodies share a common
     Frame, the value offsets for local variables in different handlers may
     overlap.  This meant locals in a handler without an initialization may
     actually end up referring to the value of a previous handler's local
     that has the same Frame offset.  When executing the body, that can
     possibly result in a type-conflict error or give give unexpected
     results instead of a "use of uninitialized value" error.

     This patch makes it so uninitialized locals do always refer to a null
     value before executing the body of a event/hook handler, so that using
     them without assigning a value within the body will connsistently give
     a "use of uninitialized value" error.
 }}}

 That's in `topic/jsiwek/ticket-932`.

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



More information about the bro-dev mailing list