binpac crashes with emply flow

Description

binpac crashes with emply flow.

Example. Remove every thing from the file "bittorrent-analyzer.pac" BitTorrent_Flow

like

  1. $Id:$
    #

  2. This code contributed by Nadi Sarrar.

connection BitTorrent_Conn(bro_analyzer: BroAnalyzer) {
upflow = BitTorrent_Flow(true);
downflow = BitTorrent_Flow(false);
};

flow BitTorrent_Flow(is_orig: bool) {
};
~
run

#binpac bittorrent.pac

you will get a core dump

switching to file ./binpac.pac
switching to file ./bro.pac
switching to file ./bittorrent-protocol.pac
switching to file ./bittorrent-analyzer.pac
Segmentation fault: 11 (core dumped)

gdb ../aux/binpac/src/binpac binpac.core

Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Core was generated by `binpac'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 AnalyzerDataUnit:repare (this=0x0, env=0x800d16ab0) at pac_dataunit.cc:40
40 dataunit_var_field_->Prepare(env);
(gdb) bt
#0 AnalyzerDataUnit:repare (this=0x0, env=0x800d16ab0) at pac_dataunit.cc:40
0x0000000000439c12 in FlowDecl:repare (this=0x800d69180) at pac_flow.cc:103
0x000000000042532b in Decl:rocessDecls (out_h=0x7fffffffea30, out_cc=0x7fffffffea20) at pac_decl.cc:77
0x00000000004622d6 in compile (filename=0x7fffffffed79 "bittorrent.pac") at pac_main.cc:164
0x00000000004631b8 in main (argc=1, argv=Variable "argv" is not available.
) at pac_main.cc:254

Environment

None

Assignee

Unassigned

Reporter

mayank

Labels

None

External issue ID

282

Components

Affects versions

Priority

Low
Configure