mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-30 03:34:26 +03:00
sync code
This commit is contained in:
@@ -80,7 +80,11 @@ cptestParseHex(const string &hex_text)
|
||||
size_t l = t.size();
|
||||
if (l==0) continue;
|
||||
if (t[l-1]==':') continue; // tcpdump uses xxxx: to mark offsets, not data. So ignore it.
|
||||
dbgAssert(t.size() %2 == 0) << "Expecting an even number of hex digits, " << t << " is invalid";
|
||||
dbgAssert(t.size() %2 == 0)
|
||||
<< AlertInfo(AlertTeam::CORE, "testing")
|
||||
<< "Expecting an even number of hex digits, "
|
||||
<< t
|
||||
<< " is invalid";
|
||||
for (uint i=0; i<t.size()/2; i++) {
|
||||
u_char n = strtoul(t.substr(i*2, 2).c_str(), nullptr, 16);
|
||||
v.push_back(n);
|
||||
|
@@ -415,7 +415,7 @@ TCPPacket::Impl::emit_tcp_options(vector<u_char> &pkt) const
|
||||
while (optbuf.size()%4 != 0) {
|
||||
vec_append(optbuf, TCPOption::NOP);
|
||||
}
|
||||
dbgAssert(optbuf.size() <= 40) << "too many tcp options. max is 40 bytes";
|
||||
dbgAssert(optbuf.size() <= 40) << AlertInfo(AlertTeam::CORE, "testing") << "too many tcp options. max is 40 bytes";
|
||||
|
||||
vec_append(pkt, optbuf);
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ TEST(CPTest, PrepareToDie)
|
||||
{
|
||||
cptestPrepareToDie();
|
||||
auto die = []() {
|
||||
dbgAssert(false) << "You killed my father";
|
||||
dbgAssert(false) << AlertInfo(AlertTeam::CORE, "testing") << "You killed my father";
|
||||
};
|
||||
EXPECT_DEATH(die(), "You killed my father");
|
||||
}
|
||||
|
Reference in New Issue
Block a user