From: Alan T. DeKok Date: Sun, 14 Dec 2025 12:30:08 +0000 (-0500) Subject: return negative on error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da332c8aee6dd9e047c1ce7fd615205bbf755861;p=thirdparty%2Ffreeradius-server.git return negative on error --- diff --git a/src/lib/util/cbor.c b/src/lib/util/cbor.c index 2aa80c421e3..38a16582388 100644 --- a/src/lib/util/cbor.c +++ b/src/lib/util/cbor.c @@ -1002,7 +1002,10 @@ ssize_t fr_cbor_decode_value_box(TALLOC_CTX *ctx, fr_value_box_t *vb, fr_dbuff_t if (type == FR_TYPE_NULL) { type = cbor_guess_type(&work_dbuff, false); - if (type == FR_TYPE_NULL) return 0; + if (type == FR_TYPE_NULL) { + fr_strerror_const("Unable to determine data type from cbor"); + return -1; + } } fr_value_box_init(vb, type, enumv, tainted); @@ -1016,7 +1019,7 @@ ssize_t fr_cbor_decode_value_box(TALLOC_CTX *ctx, fr_value_box_t *vb, fr_dbuff_t if (((info >= 28) && (info <= 30)) || ((info == 31) && ((major == 0) || (major == 1) || (major == 6)))) { fr_strerror_const("Invalid cbor data - input is not 'well formed'"); - return 0; + return -1; } switch (major) { @@ -1031,7 +1034,7 @@ ssize_t fr_cbor_decode_value_box(TALLOC_CTX *ctx, fr_value_box_t *vb, fr_dbuff_t if (info == 31) { no_chunks: fr_strerror_const("Chunked strings are not supported"); - return 0; + return -1; }