From 1c23dba39c5fa890b5cbecd007a066f030c21f4e Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Wed, 21 Aug 2019 21:33:20 +0200 Subject: [PATCH] [#851,!24-p] Avoid referencing out of bounds element of binding array. MySQL host manager issue. --- src/lib/dhcpsrv/mysql_host_data_source.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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. -- 2.47.2