[Bro-Dev] #272: topic/seth/strings-without-checkstring - Use Bytes() and Len() instead of CheckString() in strings.bif

Bro Tracker bro at tracker.icir.org
Fri Jan 21 13:59:11 PST 2011


#272: topic/seth/strings-without-checkstring - Use Bytes() and Len() instead of
CheckString() in strings.bif
----------------------------+----------------------
  Reporter:  seth           |      Owner:  seth
      Type:  Merge Request  |     Status:  assigned
  Priority:  Normal         |  Milestone:  Bro1.6
 Component:  Bro            |    Version:  1.5.2
Resolution:                 |   Keywords:  sprint
----------------------------+----------------------

Comment (by seth):

 In do_split, n is initialized to the length of the string and is used to
 count how many characters are left in the string.  Not sure why I did it
 that way, it's definitely a little confusing.

 For the change to strip, it looks like the if at the end isn't needed.
 The string length given to BroString comes out to zero if you have a
 string containing only spaces which seems to work fine.  Here is the
 status of the variables just before getting to the "if ( sp > e )"
 statement:

 {{{
 604     in strings.bif
 (gdb) print e
 $2 = (const u_char *) 0x100c89b70 "    "
 (gdb) print sp
 $3 = (const u_char *) 0x100c89b71 "   "
 (gdb) print (e-sp+1)
 $4 = 0
 (gdb)
 }}}

-- 
Ticket URL: <http://tracker.icir.org/bro/ticket/272#comment:11>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list