BIND 10 master, updated. aea6e2d1a3e08c8239323dc076cdd9cc2620b09c [master] Assign rcode
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Sep 13 10:06:05 UTC 2012
The branch, master has been updated
via aea6e2d1a3e08c8239323dc076cdd9cc2620b09c (commit)
via e15c888265457e74ee5977659d6588a2d7a0d0e2 (commit)
via ccdbcf02d9f4a2bbd69475428b86458c1ee6334a (commit)
via 6a119e4ae98b2126f8f32ba4ad69ba98bd8a3144 (commit)
via fc5c1f86c0af76912daa4a22d3dc6bece80726e4 (commit)
from 362a944a677040f1b0aa08dcd1d7e43359557ea1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit aea6e2d1a3e08c8239323dc076cdd9cc2620b09c
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 13 10:03:58 2012 +0530
[master] Assign rcode
Strictly, this is done to silence clang-analyzer. In every case,
parseAnswer() does set rcode (which is passed by reference) unless it
throws. It looks like clang-analyzer gets confused by the exception
paths.
In any case, it's good to initialize it to the unexpected case and not
depend on parseAnswer().
commit e15c888265457e74ee5977659d6588a2d7a0d0e2
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 13 10:02:23 2012 +0530
[master] Add assertion to test that cmsg != NULL
The assert() should silence clang-analyer.
commit ccdbcf02d9f4a2bbd69475428b86458c1ee6334a
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 13 15:22:22 2012 +0530
[master] Remove redundant NULL checks in PySerial
These are not required according to:
http://docs.python.org/py3k/extending/extending.html?highlight=null#null-pointers
These NULL checks cause static analysis reports in other parts of the
code where the pointers are not NULL tested before use.
commit 6a119e4ae98b2126f8f32ba4ad69ba98bd8a3144
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 13 09:39:39 2012 +0530
[master] Remove some unused assignments
Reported by clang-analyzer.
commit fc5c1f86c0af76912daa4a22d3dc6bece80726e4
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Sep 13 15:20:29 2012 +0530
[master] Handle default switch case in LoggerImpl::outputRaw()
-----------------------------------------------------------------------
Summary of changes:
src/lib/config/ccsession.cc | 8 ++++----
src/lib/dhcp/iface_mgr.cc | 7 +++++++
src/lib/dns/python/serial_python.cc | 8 --------
src/lib/log/logger_impl.cc | 9 +++++++++
src/lib/log/tests/logger_example.cc | 6 +++---
5 files changed, 23 insertions(+), 15 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/config/ccsession.cc b/src/lib/config/ccsession.cc
index d4c6653..daec005 100644
--- a/src/lib/config/ccsession.cc
+++ b/src/lib/config/ccsession.cc
@@ -456,7 +456,7 @@ ModuleCCSession::ModuleCCSession(
ConstElementPtr answer, env;
session_.group_recvmsg(env, answer, false, seq);
- int rcode;
+ int rcode = -1;
ConstElementPtr err = parseAnswer(rcode, answer);
if (rcode != 0) {
LOG_ERROR(config_logger, CONFIG_MOD_SPEC_REJECT).arg(answer->str());
@@ -535,7 +535,7 @@ ModuleCCSession::handleConfigUpdate(ConstElementPtr new_config) {
ConstElementPtr diff = removeIdentical(new_config, getLocalConfig());
// handle config update
answer = config_handler_(diff);
- int rcode;
+ int rcode = -1;
parseAnswer(rcode, answer);
if (rcode == 0) {
ElementPtr local_config = getLocalConfig();
@@ -652,7 +652,7 @@ ModuleCCSession::fetchRemoteSpec(const std::string& module, bool is_filename) {
unsigned int seq = session_.group_sendmsg(cmd, "ConfigManager");
ConstElementPtr env, answer;
session_.group_recvmsg(env, answer, false, seq);
- int rcode;
+ int rcode = -1;
ConstElementPtr spec_data = parseAnswer(rcode, answer);
if (rcode == 0 && spec_data) {
// received OK, construct the spec out of it
@@ -689,7 +689,7 @@ ModuleCCSession::addRemoteConfig(const std::string& spec_name,
ConstElementPtr env, answer;
session_.group_recvmsg(env, answer, false, seq);
- int rcode;
+ int rcode = -1;
ConstElementPtr new_config = parseAnswer(rcode, answer);
ElementPtr local_config;
if (rcode == 0 && new_config) {
diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc
index 7df809e..7f1b38b 100644
--- a/src/lib/dhcp/iface_mgr.cc
+++ b/src/lib/dhcp/iface_mgr.cc
@@ -727,6 +727,13 @@ IfaceMgr::send(const Pkt6Ptr& pkt) {
m.msg_control = &control_buf_[0];
m.msg_controllen = control_buf_len_;
struct cmsghdr *cmsg = CMSG_FIRSTHDR(&m);
+
+ // FIXME: Code below assumes that cmsg is not NULL, but
+ // CMSG_FIRSTHDR() is coded to return NULL as a possibility. The
+ // following assertion should never fail, but if it did and you came
+ // here, fix the code. :)
+ assert(cmsg != NULL);
+
cmsg->cmsg_level = IPPROTO_IPV6;
cmsg->cmsg_type = IPV6_PKTINFO;
cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
diff --git a/src/lib/dns/python/serial_python.cc b/src/lib/dns/python/serial_python.cc
index e2bd809..f4f4720 100644
--- a/src/lib/dns/python/serial_python.cc
+++ b/src/lib/dns/python/serial_python.cc
@@ -259,19 +259,11 @@ createSerialObject(const Serial& source) {
bool
PySerial_Check(PyObject* obj) {
- if (obj == NULL) {
- isc_throw(PyCPPWrapperException,
- "obj argument NULL in Serial typecheck");
- }
return (PyObject_TypeCheck(obj, &serial_type));
}
const Serial&
PySerial_ToSerial(const PyObject* serial_obj) {
- if (serial_obj == NULL) {
- isc_throw(PyCPPWrapperException,
- "obj argument NULL in Serial PyObject conversion");
- }
const s_Serial* serial = static_cast<const s_Serial*>(serial_obj);
return (*serial->cppobj);
}
diff --git a/src/lib/log/logger_impl.cc b/src/lib/log/logger_impl.cc
index 6cd3da5..689795d 100644
--- a/src/lib/log/logger_impl.cc
+++ b/src/lib/log/logger_impl.cc
@@ -151,6 +151,15 @@ LoggerImpl::outputRaw(const Severity& severity, const string& message) {
case FATAL:
LOG4CPLUS_FATAL(logger_, message);
+ break;
+
+ case NONE:
+ break;
+
+ default:
+ LOG4CPLUS_ERROR(logger_,
+ "Unsupported severity in LoggerImpl::outputRaw(): "
+ << severity);
}
if (!locker.unlock()) {
diff --git a/src/lib/log/tests/logger_example.cc b/src/lib/log/tests/logger_example.cc
index 853d48a..6f95e5d 100644
--- a/src/lib/log/tests/logger_example.cc
+++ b/src/lib/log/tests/logger_example.cc
@@ -146,7 +146,7 @@ int main(int argc, char** argv) {
if (c_found || f_found || y_found) {
cur_spec.addOutputOption(cur_opt);
cur_opt = def_opt;
- c_found = f_found = y_found = false;
+ f_found = y_found = false;
}
// Set the output option for this switch.
@@ -174,7 +174,7 @@ int main(int argc, char** argv) {
if (c_found || f_found || y_found) {
cur_spec.addOutputOption(cur_opt);
cur_opt = def_opt;
- c_found = f_found = y_found = false;
+ c_found = y_found = false;
}
// Set the output option for this switch.
@@ -236,7 +236,7 @@ int main(int argc, char** argv) {
if (c_found || f_found || y_found) {
cur_spec.addOutputOption(cur_opt);
cur_opt = def_opt;
- c_found = f_found = y_found = false;
+ c_found = f_found = false;
}
y_found = true;
cur_opt.destination = OutputOption::DEST_SYSLOG;
More information about the bind10-changes
mailing list