]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
lib/json: check return value of fr_value_box_bstrndup in fr_json_object_to_value_box
authorAlexander Bainbridge-Sedivy <alex.bainbridge@inkbridge.io>
Thu, 7 May 2026 19:02:15 +0000 (15:02 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 27 May 2026 17:38:30 +0000 (13:38 -0400)
src/lib/json/json.c

index a72f8e5cada1794d4f81d29fe171a50714175fd8..1c0db6c5857b81925cd5cc19da95f7f652bb4d4b 100644 (file)
@@ -134,7 +134,7 @@ int fr_json_object_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, json_objec
                /*
                 *      Just copy the string to the box.
                 */
-               fr_value_box_bstrndup(out, out, NULL, value, len, tainted);
+               if (fr_value_box_bstrndup(out, out, NULL, value, len, tainted) < 0) return -1;
        }
                break;
 
@@ -187,7 +187,7 @@ int fr_json_object_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, json_objec
        {
                char const *value = json_object_to_json_string(object);
 
-               fr_value_box_bstrndup(out, out, NULL, value, strlen(value), tainted);
+               if (fr_value_box_bstrndup(out, out, NULL, value, strlen(value), tainted) < 0) return -1;
        }
                break;
        }