diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-09-27 09:46:29 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-09-27 09:46:29 +0200 |
commit | b07cca0bb59300fe193015f1a8361448af72d05b (patch) | |
tree | e89f0b12e84a2a1cfa2faed918e7aea83f37e95d /src/plugins/Mangadex.cpp | |
parent | 4f89aee77ede589002ab75490fa1ab2a3ca3fe84 (diff) |
Validate json type after parsing
Diffstat (limited to 'src/plugins/Mangadex.cpp')
-rw-r--r-- | src/plugins/Mangadex.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp index 6a8f8a7..fcbd23e 100644 --- a/src/plugins/Mangadex.cpp +++ b/src/plugins/Mangadex.cpp @@ -52,6 +52,9 @@ namespace QuickMedia { return SearchResult::ERR; } + if(!json_root.isObject()) + return SearchResult::ERR; + Json::Value &status_json = json_root["status"]; if(!status_json.isString() || status_json.asString() != "OK") return SearchResult::ERR; @@ -287,6 +290,9 @@ namespace QuickMedia { return ImageResult::ERR; } + if(!json_root.isObject()) + return ImageResult::ERR; + Json::Value &status_json = json_root["status"]; if(!status_json.isString() || status_json.asString() != "OK") return ImageResult::ERR; |