[Bro-Dev] [JIRA] (BIT-1280) Checking index in vectors is broken

Jon Siwek (JIRA) jira at bro-tracker.atlassian.net
Tue Oct 28 07:50:08 PDT 2014


    [ https://bro-tracker.atlassian.net/browse/BIT-1280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18602#comment-18602 ] 

Jon Siwek commented on BIT-1280:
--------------------------------

{quote}
Just because the length of a vector is greater than a specific element does not mean that all smaller elements are set at the moment (unless I am very much mistaken).
{quote}

Yeah, I think I remember it working like that also, but not sure if it's actually intended to be used in that way.  Probably should be easy to implement the "in" operator so it just checks that.  Unless there's some larger functionality Seth wanted?

> Checking index in vectors is broken
> -----------------------------------
>
>                 Key: BIT-1280
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1280
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>    Affects Versions: 2.4
>            Reporter: Seth Hall
>
> If you try to check an index in a vector for existence, you get an error...
> {noformat}
> event bro_init()
> 	{
> 	local vec: vector of count = vector();
> 	if ( 2 in vec )
> 		print vec[2];
> 	print vec;
> 	}
> {noformat}
> Error:
> {quote}
> fatal error in bool: BroType::AsVectorType (bool/vector) (bool)
> {quote}



--
This message was sent by Atlassian JIRA
(v6.4-OD-07-004#64005)


More information about the bro-dev mailing list