]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Return on negative value (CID #1684172)
authorNick Porter <nick@portercomputing.co.uk>
Thu, 12 Mar 2026 09:40:51 +0000 (09:40 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 12 Mar 2026 09:51:53 +0000 (09:51 +0000)
src/lib/util/test/dns_tests.c

index 966f1f49a8a7a95ea07a5db2b58a03c45e0d6549..97f04b502feb8646ff4a1a32c4a6f49d3b67267e 100644 (file)
@@ -279,7 +279,7 @@ static void test_decode_simple_label(void)
 }
 
 static void test_decode_multi_label(void)
-{      
+{
        ssize_t slen;
        uint8_t const *next;
        uint8_t pkt[DNS_HDR_LEN + 17];  /* "www.example.com" */
@@ -584,6 +584,7 @@ static void test_roundtrip_underscore(void)
 
        enc_len = encode_label(buf, sizeof(buf), buf, "_tcp.example.com", false, NULL);
        TEST_CHECK(enc_len > 0);
+       if (enc_len <= 0) return;
 
        dec_len = fr_dns_label_to_value_box(ctx, &vb_out, buf, enc_len, buf, false, NULL);
        TEST_CHECK(dec_len > 0);