diff --git a/lib/dns/message.c b/lib/dns/message.c index 6f5f86149f..570b312f9b 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -118,7 +118,7 @@ msgblock_internalget(dns_msgblock_t *block, unsigned int sizeof_type) { void *ptr; - if (block->remaining == 0) + if (block == NULL || block->remaining == 0) return (NULL); block->remaining--;