]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Fixing hang in the text causing memory corruption and hang.
authorMarcin Siodelski <marcin@isc.org>
Thu, 6 Apr 2017 10:40:14 +0000 (12:40 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 6 Apr 2017 10:40:14 +0000 (12:40 +0200)
Okayed on Jabber.

src/bin/agent/tests/ca_command_mgr_unittests.cc
src/lib/asiolink/testutils/test_server_unix_socket.cc

index 9f00ceabf67be4c2d8a1b30e692908aa996d51d3..c70e76e09eaaa1a96f54dcab3051d17bb534f557 100644 (file)
@@ -318,7 +318,8 @@ TEST_F(CtrlAgentCommandMgrTest, failForwardToServer) {
 /// Check that control command is not forwarded if the service is not specified.
 TEST_F(CtrlAgentCommandMgrTest, noService) {
     testForward(CtrlAgentCfgContext::TYPE_DHCP6, "",
-                isc::config::CONTROL_RESULT_COMMAND_UNSUPPORTED);
+                isc::config::CONTROL_RESULT_COMMAND_UNSUPPORTED,
+                -1, -1, 0);
 }
 
 /// Check that error is returned to the client when the server to which the
index 6143b0489d25eff9070af9ddcfc78e2da3863c78..ab374cc062b09af40a8a2469b8227dc623812498 100644 (file)
@@ -61,7 +61,13 @@ public:
     ///
     /// @param bytes_transferred Number of bytes received.
     void
-    readHandler(const boost::system::error_code&, size_t bytes_transferred) {
+    readHandler(const boost::system::error_code& ec,
+                size_t bytes_transferred) {
+        // This is most likely due to the abort.
+        if (ec) {
+            return;
+        }
+
         if (!custom_response_.empty()) {
             boost::asio::write(*socket_,
                boost::asio::buffer(custom_response_.c_str(), custom_response_.size()));