[Bro-Dev] [JIRA] (BIT-1296) Bro segfault when using "@if" inside event handler

Jon Siwek (JIRA) jira at bro-tracker.atlassian.net
Tue Dec 2 10:57:00 PST 2014


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

Jon Siwek commented on BIT-1296:
--------------------------------

"@if" should work inside event handlers, it's just the attached test case's condition referenced a local variable.  We can't generally make a parse-time decision about local state, so in topic/jsiwek/bit-1296, I've made it an error to reference local variables inside the "@if" condition.

Could even think about making it require references to consts only.  Technically, I don't think there's any problem with globals, but it does require the programmer to realize it's the parse-time value of the global that's going to be used, not what the run-time value is when that code path is executed (one could just use a regular "if" statement for the later).  And currently it looks like there's scripts that depend on "@if" evaluating globals.  Not that it's hard to change those to use const, but there's probably a more general task to convert global functions into const functions where the intent is that they'll never be re-assigned.

> Bro segfault when using "@if" inside event handler
> --------------------------------------------------
>
>                 Key: BIT-1296
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1296
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>            Reporter: Daniel Thayer
>             Fix For: 2.4
>
>         Attachments: test.bro
>
>
> The attached script causes Bro to segfault.



--
This message was sent by Atlassian JIRA
(v6.4-OD-11-012#64007)


More information about the bro-dev mailing list