Better sbuffer assertion.

git-svn-id: file:///svn/unbound/trunk@4898 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2018-09-13 10:00:57 +00:00
parent fe8b22caa1
commit d744827f93
4 changed files with 1 additions and 4 deletions

View File

@ -160,7 +160,7 @@ sldns_buffer_invariant(sldns_buffer *buffer)
assert(buffer != NULL);
assert(buffer->_position <= buffer->_limit || buffer->_vfixed);
assert(buffer->_limit <= buffer->_capacity);
assert(buffer->_data != NULL || (buffer->_vfixed && buffer->_capacity == 0));
assert(buffer->_data != NULL || (buffer->_vfixed && buffer->_capacity == 0 && buffer->_limit == 0));
}
#endif

View File

@ -1195,7 +1195,6 @@ struct serviced_query* outnet_serviced_query(struct outside_network* outnet,
/* create packet with EDNS */
pend->buffer = sldns_buffer_new(512);
log_assert(pend->buffer);
log_assert(pend->buffer->_data);
sldns_buffer_write_u16(pend->buffer, 0); /* id */
sldns_buffer_write_u16(pend->buffer, flags);
sldns_buffer_write_u16(pend->buffer, 1); /* qdcount */

View File

@ -532,7 +532,6 @@ qlist_add_line(struct perfinfo* info, char* line, int no)
printf("error parsing query %d: %s\n", no, line);
exit(1);
}
log_assert(info->buf->_data);
sldns_buffer_write_u16_at(info->buf, 0, (uint16_t)info->qlist_size);
if(info->qlist_size + 1 > info->qlist_capacity) {
qlist_grow_capacity(info);

View File

@ -155,7 +155,6 @@ static void analyze(sldns_buffer* pkt)
{
uint16_t i, f, qd, an, ns, ar;
int rrnum = 0;
log_assert(pkt && pkt->_data);
printf("packet length %d\n", (int)sldns_buffer_limit(pkt));
if(sldns_buffer_limit(pkt) < 12) return;