mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
Fix missing assigmnent operator/copy constructor pairings reported by LGTM
This commit is contained in:
parent
2f2a265415
commit
51f17534d4
3 changed files with 35 additions and 0 deletions
|
@ -33,6 +33,11 @@ struct ConnIDKey {
|
||||||
memset(&ip2, 0, sizeof(in6_addr));
|
memset(&ip2, 0, sizeof(in6_addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConnIDKey(const ConnIDKey& rhs)
|
||||||
|
{
|
||||||
|
*this = rhs;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator<(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) < 0; }
|
bool operator<(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) < 0; }
|
||||||
bool operator==(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) == 0; }
|
bool operator==(const ConnIDKey& rhs) const { return memcmp(this, &rhs, sizeof(ConnIDKey)) == 0; }
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,22 @@ public:
|
||||||
~EncapsulatingConn()
|
~EncapsulatingConn()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
EncapsulatingConn& operator=(const EncapsulatingConn& other)
|
||||||
|
{
|
||||||
|
if ( this != &other )
|
||||||
|
{
|
||||||
|
src_addr = other.src_addr;
|
||||||
|
dst_addr = other.dst_addr;
|
||||||
|
src_port = other.src_port;
|
||||||
|
dst_port = other.dst_port;
|
||||||
|
proto = other.proto;
|
||||||
|
type = other.type;
|
||||||
|
uid = other.uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
BifEnum::Tunnel::Type Type() const
|
BifEnum::Tunnel::Type Type() const
|
||||||
{ return type; }
|
{ return type; }
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,20 @@ struct Field {
|
||||||
delete [] secondary_name;
|
delete [] secondary_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Field& operator=(const Field& other)
|
||||||
|
{
|
||||||
|
if ( this != &other )
|
||||||
|
{
|
||||||
|
name = other.name ? util::copy_string(other.name) : nullptr;
|
||||||
|
secondary_name = other.secondary_name ? util::copy_string(other.secondary_name) : nullptr;
|
||||||
|
type = other.type;
|
||||||
|
subtype = other.subtype;
|
||||||
|
optional = other.optional;
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unserializes a field.
|
* Unserializes a field.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue