]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Catch failure returned by cbor_guess_type() (CID #1634805)
authorNick Porter <nick@portercomputing.co.uk>
Fri, 29 Nov 2024 12:34:45 +0000 (12:34 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 29 Nov 2024 12:34:45 +0000 (12:34 +0000)
src/lib/util/cbor.c

index 2ae42f051d45500ccd7105538d69d3dacb3c6def..b5799105b637cc36d9380556ef2cbbda449e594d 100644 (file)
@@ -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;