mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
lint fixes: ensuring functions return values, robustness to nil Val's
This commit is contained in:
parent
e21c0f1115
commit
5a8ba8c3e5
4 changed files with 8 additions and 2 deletions
|
@ -713,6 +713,8 @@ function enable_stream(id: ID) : bool
|
|||
|
||||
if ( id in all_streams )
|
||||
active_streams[id] = all_streams[id];
|
||||
|
||||
return T;
|
||||
}
|
||||
|
||||
# convenience function to add a filter name to stream_filters
|
||||
|
|
|
@ -217,7 +217,7 @@ function set_current_threshold(c: connection, ttype: threshold_type, is_orig: bo
|
|||
return set_current_conn_packets_threshold(c$id, t, T);
|
||||
else if ( ttype == PACKETS && ! is_orig )
|
||||
return set_current_conn_packets_threshold(c$id, t, F);
|
||||
else if ( ttype == DURATION )
|
||||
else # ttype == DURATION
|
||||
return set_current_conn_duration_threshold(c$id, td);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ function id_matches_direction(id: conn_id, d: Direction): bool
|
|||
return (o_local && !r_local) || (!o_local && r_local);
|
||||
else if ( d == OUTBOUND )
|
||||
return o_local && !r_local;
|
||||
else if ( d == INBOUND )
|
||||
else # d == INBOUND
|
||||
return !o_local && r_local;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,10 @@ static int check_fmt_type(zeek::TypeTag t, zeek::TypeTag ok[])
|
|||
|
||||
static void do_fmt(const char*& fmt, zeek::Val* v, zeek::ODesc* d)
|
||||
{
|
||||
if ( ! v )
|
||||
// Help with error propagation in compiled code.
|
||||
return;
|
||||
|
||||
zeek::TypeTag t = v->GetType()->Tag();
|
||||
zeek::InternalTypeTag it = v->GetType()->InternalType();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue