2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#3785] Extra fixes for Fedora

This commit is contained in:
Francis Dupont
2025-03-12 11:00:47 +01:00
parent b48f82406b
commit 559be2b5e6
6 changed files with 9 additions and 9 deletions

View File

@@ -290,7 +290,7 @@ public:
if (cumulative_ > 2) {
uint16_t dns_length = readUint16(receive_buffer_,
sizeof(receive_buffer_));
complete = ((dns_length + 2) == cumulative_);
complete = ((static_cast<size_t>(dns_length) + 2) == cumulative_);
}
if (!complete) {

View File

@@ -211,7 +211,7 @@ OptionDataTypeUtil::readTuple(const std::vector<uint8_t>& buf,
<< buf.size());
}
uint8_t len = buf[0];
if (buf.size() < 1 + len) {
if (buf.size() < 1 + static_cast<size_t>(len)) {
isc_throw(BadDataTypeCast, "unable to read data from the buffer as"
<< " tuple (length " << static_cast<unsigned>(len)
<< "). Invalid buffer size: " << buf.size());
@@ -227,7 +227,7 @@ OptionDataTypeUtil::readTuple(const std::vector<uint8_t>& buf,
<< buf.size());
}
uint16_t len = isc::util::readUint16(&buf[0], 2);
if (buf.size() < 2 + len) {
if (buf.size() < 2 + static_cast<size_t>(len)) {
isc_throw(BadDataTypeCast, "unable to read data from the buffer as"
<< " tuple (length " << len
<< "). Invalid buffer size: " << buf.size());

View File

@@ -239,7 +239,7 @@ bufferToCharString(isc::util::InputBuffer& buffer, size_t rdata_len,
"insufficient data to read character-string length");
}
const uint8_t len = buffer.readUint8();
if (rdata_len < len + 1) {
if (rdata_len < static_cast<size_t>(len) + 1) {
isc_throw(isc::dns::DNSMessageFORMERR,
"character string length is too large: " <<
static_cast<int>(len));

View File

@@ -134,7 +134,7 @@ LabelSequence::serialize(void* buf, size_t buf_len) const {
bp += ndata_len;
isc_throw_assert(bp - reinterpret_cast<const uint8_t*>(buf) ==
static_cast<const ssize_t>(expected_size));
static_cast<ssize_t>(expected_size));
}
bool

View File

@@ -73,8 +73,8 @@ TEST_F(DNSSECTimeTest, fromText) {
// On the other hand, the 64-bit version should return monotonically
// increasing counters.
EXPECT_EQ(4294967296LL, timeFromText64("21060207062816"));
EXPECT_EQ(4294967306LL, timeFromText64("21060207062826"));
EXPECT_EQ(4294967296LLU, timeFromText64("21060207062816"));
EXPECT_EQ(4294967306LLU, timeFromText64("21060207062826"));
}
// This helper templated function tells timeToText32 a faked current time.
@@ -144,4 +144,4 @@ TEST_F(DNSSECTimeTest, overflow) {
EXPECT_THROW(timeToText32(4294197632LU), InvalidTime);
}
} // namespace
} // namespace

View File

@@ -52,7 +52,7 @@ public:
do {
const uint8_t len = buffer.readUint8();
if (rdata_len < len + 1) {
if (rdata_len < static_cast<size_t>(len) + 1) {
isc_throw(DNSMessageFORMERR, "Error in parsing " <<
RRType(typeCode) <<
" RDATA: character string length is too large: " <<