From: Alexander Bainbridge-Sedivy Date: Thu, 7 May 2026 19:02:15 +0000 (-0400) Subject: lib/json: check return value of fr_value_box_bstrndup in fr_json_object_to_value_box X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be7d6534a780cda2446b85b511fc0aeaf528f910;p=thirdparty%2Ffreeradius-server.git lib/json: check return value of fr_value_box_bstrndup in fr_json_object_to_value_box --- diff --git a/src/lib/json/json.c b/src/lib/json/json.c index a72f8e5cada..1c0db6c5857 100644 --- a/src/lib/json/json.c +++ b/src/lib/json/json.c @@ -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; }