]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#851,!24-p] Avoid referencing out of bounds element of binding array.
authorMarcin Siodelski <marcin@isc.org>
Wed, 21 Aug 2019 19:33:20 +0000 (21:33 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 21 Aug 2019 19:33:20 +0000 (21:33 +0200)
MySQL host manager issue.

src/lib/dhcpsrv/mysql_host_data_source.cc

index 6e4b79f99402c6479021e65b5a3dfd86212ca484..e577b4ac3222ff2ec1a7e591a1df9ddf7b2b317c 100644 (file)
@@ -381,9 +381,8 @@ public:
                       << host->getHostname() << ", reason: " << ex.what());
         }
 
-        // Add the data to the vector.  Note the end element is one after the
-        // end of the array.
-        return (std::vector<MYSQL_BIND>(&bind_[0], &bind_[columns_num_]));
+        // Add the data to the vector.
+        return (std::vector<MYSQL_BIND>(bind_.begin(), bind_.begin() + columns_num_));
     };
 
     /// @brief Create BIND array to receive Host data.