diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2023-06-02 19:39:16 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-06-02 19:39:16 +0200 |
commit | e9c7419b42d258ce2012fd0cddb0003ba299e7b3 (patch) | |
tree | 872565e844098f20647f09eb149a4742aa50800a | |
parent | 06394c6c003cc0cab3a2a5a8783db4c9610f67a5 (diff) | |
download | seitan-e9c7419b42d258ce2012fd0cddb0003ba299e7b3.tar seitan-e9c7419b42d258ce2012fd0cddb0003ba299e7b3.tar.gz seitan-e9c7419b42d258ce2012fd0cddb0003ba299e7b3.tar.bz2 seitan-e9c7419b42d258ce2012fd0cddb0003ba299e7b3.tar.lz seitan-e9c7419b42d258ce2012fd0cddb0003ba299e7b3.tar.xz seitan-e9c7419b42d258ce2012fd0cddb0003ba299e7b3.tar.zst seitan-e9c7419b42d258ce2012fd0cddb0003ba299e7b3.zip |
cooker: json_object_get_boolean() can return true for missing key
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | cooker/parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cooker/parse.c b/cooker/parse.c index 46134b5..1cc6296 100644 --- a/cooker/parse.c +++ b/cooker/parse.c @@ -56,8 +56,8 @@ static void handle_fd(struct gluten_ctx *g, JSON_Value *value) die("invalid \"new\" in \"fd\""); } - if (json_object_get_boolean(obj, "return")) - desc.do_return = 1; + if (json_object_get_value(obj, "return")) + desc.do_return = json_object_get_boolean(obj, "return") if (json_object_get_value(obj, "close_on_exec")) desc.cloexec = json_object_get_boolean(obj, "close_on_exec"); |