]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix issue in JSON bool evaluation
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 18 Jan 2021 13:42:14 +0000 (13:42 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 18 Jan 2021 13:42:30 +0000 (13:42 +0000)
src/lib/json/json.c

index ec6f7ebc8e4a3d0723aa38e618c3dab1f2ec2fcf..550971eb815fdffaa556a3e8fccacf7ad31a160b 100644 (file)
@@ -153,8 +153,8 @@ int fr_json_object_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, json_objec
                break;
 
        case json_type_boolean:
-               /* Don't cast to bool, else -Wbad-function-cast */
-               fr_value_box_shallow(out, (json_object_get_boolean(object) > 0), tainted);
+               /* Must be cast to bool for correct generic case selection */
+               fr_value_box_shallow(out, ((bool)(json_object_get_boolean(object) > 0)), tainted);
                break;
 
        case json_type_null: