Commit 4dfd330a authored by Francis Dupont's avatar Francis Dupont

[master] Finishing merge of trac5449 (Fixes from analyzers)

parents da9f4b15 4dfee545
......@@ -756,7 +756,7 @@ Dhcpv4Srv::run_one() {
// we were interrupted. And we don't want to print a message every
// second.
} catch (const SignalInterruptOnSelect) {
} catch (const SignalInterruptOnSelect&) {
// Packet reception interrupted because a signal has been received.
// This is not an error because we might have received a SIGTERM,
// SIGINT, SIGHUP or SIGCHLD which are handled by the server. For
......
......@@ -441,7 +441,7 @@ void Dhcpv6Srv::run_one() {
// second.
} catch (const SignalInterruptOnSelect) {
} catch (const SignalInterruptOnSelect&) {
// Packet reception interrupted because a signal has been received.
// This is not an error because we might have received a SIGTERM,
// SIGINT or SIGHUP which are handled by the server. For signals
......
......@@ -142,8 +142,11 @@ Dhcpv6SrvTest::acquireAndDecline(Dhcp6Client& client,
// Use the second duid
client.setDUID(duid2);
// Use the second IAID
client.config_.leases_[0].iaid_ = iaid2;
// Use the second IAID (but not in NO_IA which has cleared leases)
if (addr_type != NO_IA) {
ASSERT_NE(0, client.config_.leases_.size());
client.config_.leases_[0].iaid_ = iaid2;
}
// Ok, let's decline the lease.
ASSERT_NO_THROW(client.doDecline(include_address_));
......
// Copyright (C) 2010-2017 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -425,9 +425,9 @@ public:
/// @param in The string to parse the element from
/// @param preproc specified whether preprocessing (e.g. comment removal)
/// should be performed
/// @throw JSONError
/// @return An ElementPtr that contains the element(s) specified
/// in the given input stream.
/// @throw JSONError
static ElementPtr fromJSON(std::istream& in, bool preproc = false);
/// Creates an Element from the given input stream containing JSON
......@@ -437,6 +437,7 @@ public:
/// @param file_name specified input file name (used in error reporting)
/// @param preproc specified whether preprocessing (e.g. comment removal)
/// should be performed
/// @throw JSONError
/// @return An ElementPtr that contains the element(s) specified
/// in the given input stream.
/// @throw JSONError
......@@ -452,6 +453,7 @@ public:
/// track of the current line.
/// @param pos A reference to the int where the function keeps
/// track of the current position within the current line.
/// @throw JSONError
/// @return An ElementPtr that contains the element(s) specified
/// in the given input stream.
// make this one private?
......
......@@ -37,6 +37,12 @@ public:
SecBuf(const std::vector<T>& x) : vec_(x) {}
~SecBuf() {
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
// Make the address sanitizer happy assuming this won't reallocate
vec_.resize(vec_.capacity());
#endif
#endif
std::memset(&vec_[0], 0, vec_.capacity() * sizeof(T));
};
......@@ -65,6 +71,12 @@ public:
};
void clear() {
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
// Make the address sanitizer happy assuming this won't reallocate
vec_.resize(vec_.capacity());
#endif
#endif
std::memset(&vec_[0], 0, vec_.capacity() * sizeof(T));
vec_.clear();
}
......
// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -538,6 +538,9 @@ Pkt6::getMACFromDUID() {
}
uint8_t hlen = opt_duid->getData().size();
if (!hlen) {
return (mac);
}
vector<uint8_t> hw_addr(hlen, 0);
std::vector<unsigned char> duid_data = opt_duid->getData();
......
......@@ -40,9 +40,15 @@ EvalContext::parseString(const std::string& str, ParserType type)
file_ = "<string>";
string_ = str;
scanStringBegin(type);
isc::eval::EvalParser parser(*this);
parser.set_debug_level(trace_parsing_);
int res = parser.parse();
int res = -1;
try {
isc::eval::EvalParser parser(*this);
parser.set_debug_level(trace_parsing_);
res = parser.parse();
} catch (...) {
scanStringEnd();
throw;
}
scanStringEnd();
return (res == 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment