summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-07-28 23:10:18 +0200
committerTom Gundersen <teg@jklm.no>2015-07-28 23:25:52 +0200
commit2ad613addbabc3ffec6d12a1b5c62ff0d07b4a29 (patch)
tree5fe162a76cbaeffea86eb0e5e8da99ae668bf51a /src/resolve/resolved-dns-packet.c
parent1792f2231fb246396e3f50e465194dd93565b1c7 (diff)
resolved: packet - fix read_type_window()
We were tracking the bit offset inside each byte, rather than inside the whole bitmap.
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r--src/resolve/resolved-dns-packet.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index 8c5306cc83..88a3089a72 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -1156,6 +1156,7 @@ static int dns_packet_read_type_window(DnsPacket *p, Bitmap **types, size_t *sta
uint8_t window;
uint8_t length;
const uint8_t *bitmap;
+ uint8_t bit = 0;
unsigned i;
bool found = false;
size_t saved_rindex;
@@ -1187,10 +1188,10 @@ static int dns_packet_read_type_window(DnsPacket *p, Bitmap **types, size_t *sta
for (i = 0; i < length; i++) {
uint8_t bitmask = 1 << 7;
- uint8_t bit = 0;
if (!bitmap[i]) {
found = false;
+ bit += 8;
continue;
}