]> git.ipfire.org Git - thirdparty/pdns.git/commit
Use obj.data() instead of &obj.at(0) to prevent exception 6380/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 23 Mar 2018 16:11:43 +0000 (17:11 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 23 Mar 2018 16:11:43 +0000 (17:11 +0100)
commitc2a16005ce822b3d704d2e717d734ee94e4ed189
tree1c78bc77e527edee555e8adae328583ae2b1a5c5
parentdcb4d6100091f728641ff228176a8cad657d3354
Use obj.data() instead of &obj.at(0) to prevent exception

In case of a 0-sized container, &obj.at(0) would throw an exception
even if we don't intend to use the pointer afterward.
obj.data is required to provide a non-nullptr pointer that we should
not dereference for most containers (except strings since C++11),
but that's fine for the way we intend (not to) use it.
modules/pipebackend/coprocess.cc
modules/remotebackend/pipeconnector.cc
pdns/dnsdist-tcp.cc
pdns/misc.cc
pdns/opensslsigners.cc
pdns/pkcs11signers.cc
pdns/sodcrypto.cc