]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3682] Segfault fix in handling hosts with DUIDs
authorTomek Mrugalski <tomasz@isc.org>
Fri, 13 Nov 2015 11:00:36 +0000 (12:00 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 13 Nov 2015 11:00:36 +0000 (12:00 +0100)
src/lib/dhcpsrv/mysql_host_data_source.cc

index 906bb4a112157a17213d34ae3bce0c8fcd52177e..dba704c6c2446e539e2a23ecd06ce23b0e53f229 100644 (file)
@@ -230,7 +230,7 @@ public:
                dhcp_identifier_length_ = host_->getDuid()->getDuid().size();
                bind_[1].buffer_type = MYSQL_TYPE_BLOB;
                 bind_[1].buffer = reinterpret_cast<char*>
-                                    (host_->getDuid()->getDuid()[0]);
+                    (const_cast<uint8_t*>(&(host_->getDuid()->getDuid()[0])));
                 bind_[1].buffer_length = dhcp_identifier_length_;
                 bind_[1].length = &dhcp_identifier_length_;
                 // bind_[1].is_null = &MLM_FALSE; // commented out for performance