mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/master' into topic/seth/metrics-merge
This commit is contained in:
commit
7d7d30e1f7
3 changed files with 31 additions and 4 deletions
5
CHANGES
5
CHANGES
|
@ -1,4 +1,9 @@
|
||||||
|
|
||||||
|
2.1-397 | 2013-04-29 21:19:00 -0700
|
||||||
|
|
||||||
|
* Fixing memory leaks in CompHash implementation. Addresses #987.
|
||||||
|
(Robin Sommer)
|
||||||
|
|
||||||
2.1-394 | 2013-04-27 15:02:31 -0700
|
2.1-394 | 2013-04-27 15:02:31 -0700
|
||||||
|
|
||||||
* Fixed a bug in the vulnerable software script and added a test.
|
* Fixed a bug in the vulnerable software script and added a test.
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
2.1-394
|
2.1-397
|
||||||
|
|
|
@ -77,7 +77,7 @@ char* CompositeHash::SingleValHash(int type_check, char* kp0,
|
||||||
*kp = ( v ? 1 : 0);
|
*kp = ( v ? 1 : 0);
|
||||||
kp0 = reinterpret_cast<char*>(kp+1);
|
kp0 = reinterpret_cast<char*>(kp+1);
|
||||||
|
|
||||||
if ( ! v )
|
if ( ! v )
|
||||||
return kp0;
|
return kp0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,16 +181,24 @@ char* CompositeHash::SingleValHash(int type_check, char* kp0,
|
||||||
Val* key = lv->Index(i);
|
Val* key = lv->Index(i);
|
||||||
if ( ! (kp1 = SingleValHash(type_check, kp1, key->Type(), key,
|
if ( ! (kp1 = SingleValHash(type_check, kp1, key->Type(), key,
|
||||||
false)) )
|
false)) )
|
||||||
|
{
|
||||||
|
Unref(lv);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! v->Type()->IsSet() )
|
if ( ! v->Type()->IsSet() )
|
||||||
{
|
{
|
||||||
Val* val = tv->Lookup(key);
|
Val* val = tv->Lookup(key);
|
||||||
if ( ! (kp1 = SingleValHash(type_check, kp1, val->Type(),
|
if ( ! (kp1 = SingleValHash(type_check, kp1, val->Type(),
|
||||||
val, false)) )
|
val, false)) )
|
||||||
|
{
|
||||||
|
Unref(lv);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Unref(lv);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -454,16 +462,27 @@ int CompositeHash::SingleTypeKeySize(BroType* bt, const Val* v,
|
||||||
Val* key = lv->Index(i);
|
Val* key = lv->Index(i);
|
||||||
sz = SingleTypeKeySize(key->Type(), key, type_check, sz, false,
|
sz = SingleTypeKeySize(key->Type(), key, type_check, sz, false,
|
||||||
calc_static_size);
|
calc_static_size);
|
||||||
if ( ! sz ) return 0;
|
if ( ! sz )
|
||||||
|
{
|
||||||
|
Unref(lv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! bt->IsSet() )
|
if ( ! bt->IsSet() )
|
||||||
{
|
{
|
||||||
Val* val = tv->Lookup(key);
|
Val* val = tv->Lookup(key);
|
||||||
sz = SingleTypeKeySize(val->Type(), val, type_check, sz,
|
sz = SingleTypeKeySize(val->Type(), val, type_check, sz,
|
||||||
false, calc_static_size);
|
false, calc_static_size);
|
||||||
if ( ! sz ) return 0;
|
if ( ! sz )
|
||||||
|
{
|
||||||
|
Unref(lv);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Unref(lv);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -830,7 +849,10 @@ const char* CompositeHash::RecoverOneVal(const HashKey* k, const char* kp0,
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( int i = 0; i < n; ++i )
|
for ( int i = 0; i < n; ++i )
|
||||||
|
{
|
||||||
tv->Assign(keys[i], t->IsSet() ? 0 : values[i]);
|
tv->Assign(keys[i], t->IsSet() ? 0 : values[i]);
|
||||||
|
Unref(keys[i]);
|
||||||
|
}
|
||||||
|
|
||||||
pval = tv;
|
pval = tv;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue