Check integer range during decoding
This commit also moves ControlResponse test suite to the correct
place under mgmt/ instead of mgmt/nfd/.
refs #3200
Change-Id: I1a0578b3e68b8c36c84a6af03d0c47bebe598fe1
diff --git a/src/mgmt/control-response.cpp b/src/mgmt/control-response.cpp
index 9d82d40..3045783 100644
--- a/src/mgmt/control-response.cpp
+++ b/src/mgmt/control-response.cpp
@@ -79,7 +79,7 @@
if (val == m_wire.elements_end() || val->type() != tlv::nfd::StatusCode) {
BOOST_THROW_EXCEPTION(Error("missing StatusCode sub-element"));
}
- m_code = readNonNegativeInteger(*val);
+ m_code = readNonNegativeIntegerAs<uint32_t>(*val);
++val;
if (val == m_wire.elements_end() || val->type() != tlv::nfd::StatusText) {