From: Marcin Siodelski Date: Wed, 21 Aug 2019 19:33:20 +0000 (+0200) Subject: [#851,!24-p] Avoid referencing out of bounds element of binding array. X-Git-Tag: Kea-1.6.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c23dba39c5fa890b5cbecd007a066f030c21f4e;p=thirdparty%2Fkea.git [#851,!24-p] Avoid referencing out of bounds element of binding array. MySQL host manager issue. --- diff --git a/src/lib/dhcpsrv/mysql_host_data_source.cc b/src/lib/dhcpsrv/mysql_host_data_source.cc index 6e4b79f994..e577b4ac32 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/src/lib/dhcpsrv/mysql_host_data_source.cc @@ -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(&bind_[0], &bind_[columns_num_])); + // Add the data to the vector. + return (std::vector(bind_.begin(), bind_.begin() + columns_num_)); }; /// @brief Create BIND array to receive Host data.