]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Bad function cast
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 16 Jan 2021 21:24:56 +0000 (21:24 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 16 Jan 2021 21:24:56 +0000 (21:24 +0000)
src/lib/json/json.c

index 3e94ac2b05b88dac17d69b6a7fdfd90da72f39f6..ec6f7ebc8e4a3d0723aa38e618c3dab1f2ec2fcf 100644 (file)
@@ -153,7 +153,8 @@ int fr_json_object_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, json_objec
                break;
 
        case json_type_boolean:
-               fr_value_box_shallow(out, (bool)json_object_get_boolean(object), tainted);
+               /* Don't cast to bool, else -Wbad-function-cast */
+               fr_value_box_shallow(out, (json_object_get_boolean(object) > 0), tainted);
                break;
 
        case json_type_null: