From: Nick Porter Date: Fri, 29 Nov 2024 12:34:45 +0000 (+0000) Subject: Catch failure returned by cbor_guess_type() (CID #1634805) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5ce9e0b1330841eee09355da543e8eed268729c;p=thirdparty%2Ffreeradius-server.git Catch failure returned by cbor_guess_type() (CID #1634805) --- diff --git a/src/lib/util/cbor.c b/src/lib/util/cbor.c index 2ae42f051d4..b5799105b63 100644 --- a/src/lib/util/cbor.c +++ b/src/lib/util/cbor.c @@ -1001,6 +1001,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 < 0) { + fr_strerror_printf("Invalid cbor - insufficient data"); + return type; + } if (type == FR_TYPE_NULL) { fr_strerror_printf("Invalid cbor - unable to determine data type"); return 0;