Branch Coverage

src/ldns/wire2host.c
Criterion Covered Total %
branch 65 110 59.0


line true false branch
67 0 418 if (pos == NULL) {
70 0 418 if (*pos >= max) {
74 1029 418 while (label_size > 0) {
76 537 1029 while (label_size >= 192) {
77 322 215 if (compression_pos == 0) {
84 0 537 if (*pos + 2 > max) {
91 0 537 if (pointer_target == 0) {
93 0 537 } else if (pointer_target >= max) {
95 0 537 } else if (pointer_count > LDNS_MAX_POINTERS) {
101 0 1029 if(label_size == 0)
103 0 1029 if (label_size > LDNS_MAX_LABELLEN) {
106 0 1029 if (*pos + 1 + label_size > max) {
111 0 1029 if (dname_pos + 1 > LDNS_MAX_DOMAINLEN) {
115 1029 0 if (label_size > 0) {
119 0 1029 if (dname_pos + label_size > LDNS_MAX_DOMAINLEN) {
127 1029 0 if (*pos < max) {
132 322 96 if (compression_pos > 0) {
138 0 418 if (dname_pos >= LDNS_MAX_DOMAINLEN) {
147 0 418 if (!*dname) {
174 0 245 if (*pos + 2 > max) {
181 0 245 if (*pos + rd_length > max) {
201 0 145 LDNS_STATUS_CHECK_RETURN(status);
244 0 0 if (*pos + 2 > end) {
251 0 0 if (*pos + 4 > end) {
284 532 145 if (cur_rdf_length > 0) {
285 0 532 if (cur_rdf_length + *pos > end) {
289 0 532 if (!data) {
299 677 0 if (cur_rdf) {
327 0 273 LDNS_STATUS_CHECK_GOTO(status, status_error);
331 0 273 if (*pos + 4 > max) {
342 245 28 if (section != LDNS_SECTION_QUESTION) {
343 0 245 if (*pos + 4 > max) {
352 0 245 LDNS_STATUS_CHECK_GOTO(status, status_error);
369 0 28 if (*pos + LDNS_HEADER_SIZE > max) {
416 0 28 LDNS_STATUS_CHECK_GOTO(status, status_error);
418 28 28 for (i = 0; i < ldns_pkt_qdcount(packet); i++) {
421 0 28 if (status == LDNS_STATUS_PACKET_OVERFLOW) {
424 0 28 LDNS_STATUS_CHECK_GOTO(status, status_error);
425 0 28 if (!ldns_rr_list_push_rr(ldns_pkt_question(packet), rr)) {
430 116 28 for (i = 0; i < ldns_pkt_ancount(packet); i++) {
432 0 116 if (status == LDNS_STATUS_PACKET_OVERFLOW) {
435 0 116 LDNS_STATUS_CHECK_GOTO(status, status_error);
436 0 116 if (!ldns_rr_list_push_rr(ldns_pkt_answer(packet), rr)) {
441 50 28 for (i = 0; i < ldns_pkt_nscount(packet); i++) {
443 0 50 if (status == LDNS_STATUS_PACKET_OVERFLOW) {
446 0 50 LDNS_STATUS_CHECK_GOTO(status, status_error);
447 0 50 if (!ldns_rr_list_push_rr(ldns_pkt_authority(packet), rr)) {
452 79 28 for (i = 0; i < ldns_pkt_arcount(packet); i++) {
454 0 79 if (status == LDNS_STATUS_PACKET_OVERFLOW) {
457 0 79 LDNS_STATUS_CHECK_GOTO(status, status_error);
459 2 77 if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_OPT) {
466 0 2 if (ldns_rr_rdf(rr, 0)) {
471 0 77 } else if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_TSIG) {
474 0 77 } else if (!ldns_rr_list_push_rr(ldns_pkt_additional(packet), rr)) {
480 2 26 if(have_edns)