mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Check expected size properly on DNS::extract_metadata
Thanks @shshzi for finding this one
This commit is contained in:
@@ -52,7 +52,7 @@ using Tins::Memory::OutputMemoryStream;
|
||||
namespace Tins {
|
||||
|
||||
PDU::metadata DNS::extract_metadata(const uint8_t *buffer, uint32_t total_sz) {
|
||||
if (TINS_UNLIKELY(sizeof(dns_header))) {
|
||||
if (TINS_UNLIKELY(total_sz < sizeof(dns_header))) {
|
||||
throw malformed_packet();
|
||||
}
|
||||
return metadata(total_sz, pdu_flag, PDU::UNKNOWN);
|
||||
|
||||
Reference in New Issue
Block a user