[Bro-Dev] [JIRA] (BIT-1350) Anonymous inner record insufficient type checking

Jon Siwek (JIRA) jira at bro-tracker.atlassian.net
Mon Apr 27 14:44:00 PDT 2015


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

Jon Siwek commented on BIT-1350:
--------------------------------

topic/jsiwek/bit-1350

> Anonymous inner record insufficient type checking
> -------------------------------------------------
>
>                 Key: BIT-1350
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1350
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>            Reporter: Jon Siwek
>             Fix For: 2.5
>
>
> This mistake should be caught at parse-time:
> {code}
> global crash = "80/tcp";
> type myrec: record {
>     cid: conn_id;
> };
> event bro_init()
>     {
>     local mr: myrec;    mr = [$cid = [$orig_h=1.2.3.4,$orig_p=0/tcp,$resp_h=0.0.0.0,$resp_p=crash]];
>     get_port_transport_proto(mr$cid$resp_p);
>     }
> {code}
> instead it errors out at runtime: fatal error in ././test.bro, line 1: Val::CONVERTER (string/port) (80/tcp)



--
This message was sent by Atlassian JIRA
(v6.5-OD-01-120#65000)


More information about the bro-dev mailing list