nbtool icon indicating copy to clipboard operation
nbtool copied to clipboard

dns.c

Open mildok opened this issue 3 years ago • 0 comments

https://github.com/iagox86/nbtool/blob/bf90c76221c3005ef537f587dd267f085551d014/dns.c#L353

Line 353, was: /* Read the rest of the data -- for a bit of safety so we don't read too far, do some math to figure out exactly what's left. */ buffer_read_next_bytes(buffer, dns->answers[i].answer->NBSTAT.stats, MIN(64, size - 1 - (dns->answers[i].answer->NBSTAT.name_count * 16)));

Replace 16 to 18: /* My redact - buffer_read_next_bytes(buffer, tmp, 16) = read from buffer 16 byte, and buffer_read_next_int16(buffer) = read from buffer 2 byte; 16+2 = 18*/ /* Read the rest of the data -- for a bit of safety so we don't read too far, do some math to figure out exactly what's left. */ buffer_read_next_bytes(buffer, dns->answers[i].answer->NBSTAT.stats, MIN(64, size - 1 - (dns->answers[i].answer->NBSTAT.name_count * (18) )));

Also Line 464, replace 16 to 18: /* Read the rest of the data -- for a bit of safety so we don't read too far, do some math to figure out exactly what's left. */ buffer_read_next_bytes(buffer, dns->additionals[i].additional->NBSTAT.stats, MIN(64, size - 1 - (dns->additionals[i].additional->NBSTAT.name_count * 16)));

Change to: /* My redact - buffer_read_next_bytes(buffer, tmp, 16) = read from buffer 16 byte, and buffer_read_next_int16(buffer) = read from buffer 2 byte; 16+2 = 18*/ /* Read the rest of the data -- for a bit of safety so we don't read too far, do some math to figure out exactly what's left. */ buffer_read_next_bytes(buffer, dns->additionals[i].additional->NBSTAT.stats, MIN(64, size - 1 - (dns->additionals[i].additional->NBSTAT.name_count * 18)));

Thank u so much for ur code - it was very useful for me. =)

mildok avatar Oct 16 '22 02:10 mildok