mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
resolved: when serializing NSEC3 windows, don't write more windows than necessary
This commit is contained in:
parent
e1a9f1a81d
commit
d0ae14ff09
@ -659,15 +659,16 @@ static int dns_packet_append_types(DnsPacket *p, Bitmap *types, size_t *start) {
|
||||
}
|
||||
|
||||
window = n >> 8;
|
||||
|
||||
entry = n & 255;
|
||||
|
||||
bitmaps[entry / 8] |= 1 << (7 - (entry % 8));
|
||||
}
|
||||
|
||||
r = dns_packet_append_type_window(p, window, entry / 8 + 1, bitmaps, NULL);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
if (bitmaps[entry / 8] != 0) {
|
||||
r = dns_packet_append_type_window(p, window, entry / 8 + 1, bitmaps, NULL);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (start)
|
||||
*start = saved_size;
|
||||
|
Loading…
x
Reference in New Issue
Block a user