]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
unit_test_attribute: Encoding 0 bytes is an error too
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 14 Mar 2020 04:07:08 +0000 (00:07 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 14 Mar 2020 04:07:08 +0000 (00:07 -0400)
At least in terms of the unit tests

src/bin/unit_test_attribute.c

index a4aa5ac8136cfe2f981e7dfde8b4e3bdce64a152..21016e65d9f86381e1305dda41bd60ffdc717aa0 100644 (file)
@@ -1188,7 +1188,7 @@ static size_t command_decode_pair(command_result_t *result, command_ctx_t *cc,
        while (to_dec < to_dec_end) {
                slen = tp->func(cc->tmp_ctx, &cursor, cc->active_dict ? cc->active_dict : cc->config->dict,
                                (uint8_t *)to_dec, (to_dec_end - to_dec), decoder_ctx);
-               if (slen < 0) {
+               if (slen <= 0) {
                        fr_pair_list_free(&head);
                        CLEAR_TEST_POINT(cc);
                        RETURN_OK_WITH_ERROR();