1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fixed invalid parsing of unknown DNS records.

This commit is contained in:
Matias Fontanini
2014-08-07 21:22:31 -03:00
parent 8a44b29d92
commit 5d0ba22ac4

View File

@@ -438,12 +438,14 @@ void DNS::convert_records(const uint8_t *ptr, const uint8_t *end, resources_type
used_small_buffer = true;
break;
default:
if(data_size <= 256) {
if(data_size < sizeof(small_addr_buf) - 1) {
std::copy(
ptr,
ptr + data_size,
small_addr_buf
);
// null terminator
small_addr_buf[data_size] = 0;
used_small_buffer = true;
}
else