Small but important fix for the input framework. BroStrings were constructed

without a final \0 - which means that strings read by the input framework are
unusable by basically all internal functions (like to_count).

the basic test now also checks this.

Thanks at Sheharbano for noticing this.
This commit is contained in:
Bernhard Amann 2012-10-01 13:04:40 -07:00
parent 474ab86b9c
commit 4cbf4e3caf
3 changed files with 8 additions and 5 deletions

View file

@ -2007,7 +2007,7 @@ Val* Manager::ValueToVal(const Value* val, BroType* request_type)
case TYPE_STRING:
{
BroString *s = new BroString((const u_char*)val->val.string_val.data, val->val.string_val.length, 0);
BroString *s = new BroString((const u_char*)val->val.string_val.data, val->val.string_val.length, 1);
return new StringVal(s);
}