Skip to content

Commit 3d52183

Browse files
committed
Return on negative value (CID #1684172)
1 parent 6722522 commit 3d52183

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/util/test/dns_tests.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static void test_decode_simple_label(void)
279279
}
280280

281281
static void test_decode_multi_label(void)
282-
{
282+
{
283283
ssize_t slen;
284284
uint8_t const *next;
285285
uint8_t pkt[DNS_HDR_LEN + 17]; /* "www.example.com" */
@@ -584,6 +584,7 @@ static void test_roundtrip_underscore(void)
584584

585585
enc_len = encode_label(buf, sizeof(buf), buf, "_tcp.example.com", false, NULL);
586586
TEST_CHECK(enc_len > 0);
587+
if (enc_len <= 0) return;
587588

588589
dec_len = fr_dns_label_to_value_box(ctx, &vb_out, buf, enc_len, buf, false, NULL);
589590
TEST_CHECK(dec_len > 0);

0 commit comments

Comments
 (0)