|
@@ -1855,6 +1855,9 @@ DNSKEY::compare(const Rdata& other) const {
|
|
|
const size_t this_len = impl_->keydata_.size();
|
|
|
const size_t other_len = other_dnskey.impl_->keydata_.size();
|
|
|
const size_t cmplen = min(this_len, other_len);
|
|
|
+ if (cmplen == 0) {
|
|
|
+ return ((this_len == other_len) ? 0 : (this_len < other_len) ? -1 : 1);
|
|
|
+ }
|
|
|
const int cmp = memcmp(&impl_->keydata_[0],
|
|
|
&other_dnskey.impl_->keydata_[0], cmplen);
|
|
|
if (cmp != 0) {
|
|
@@ -3961,7 +3964,9 @@ OPT::appendPseudoRR(uint16_t code, const uint8_t* data, uint16_t length) {
|
|
|
|
|
|
boost::shared_ptr<std::vector<uint8_t> >
|
|
|
option_data(new std::vector<uint8_t>(length));
|
|
|
- std::memcpy(&(*option_data)[0], data, length);
|
|
|
+ if (length != 0) {
|
|
|
+ std::memcpy(&(*option_data)[0], data, length);
|
|
|
+ }
|
|
|
impl_->pseudo_rrs_.push_back(PseudoRR(code, option_data));
|
|
|
impl_->rdlength_ += length;
|
|
|
}
|