From f3959e140106334b33cf74832fc5b20d27407d0a Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Fri, 22 Jul 2016 20:02:36 +0600 Subject: CLOUD: Upload ListDirectory Requests Lots of checks to avoid JSON-related segfaults added. --- backends/networking/curl/curljsonrequest.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'backends/networking/curl/curljsonrequest.h') diff --git a/backends/networking/curl/curljsonrequest.h b/backends/networking/curl/curljsonrequest.h index 1d1409efc8..cab75bf4bc 100644 --- a/backends/networking/curl/curljsonrequest.h +++ b/backends/networking/curl/curljsonrequest.h @@ -54,8 +54,11 @@ public: virtual void restart(); static bool jsonIsObject(Common::JSONValue *item, const char *warningPrefix); - static bool jsonContainsString(Common::JSONObject &item, const char *key, const char *warningPrefix); - static bool jsonContainsIntegerNumber(Common::JSONObject &item, const char *key, const char *warningPrefix); + static bool jsonContainsString(Common::JSONObject &item, const char *key, const char *warningPrefix, bool isOptional = false); + static bool jsonContainsIntegerNumber(Common::JSONObject &item, const char *key, const char *warningPrefix, bool isOptional = false); + static bool jsonContainsArray(Common::JSONObject &item, const char *key, const char *warningPrefix, bool isOptional = false); + static bool jsonContainsStringOrIntegerNumber(Common::JSONObject &item, const char *key, const char *warningPrefix, bool isOptional = false); + static bool jsonContainsAttribute(Common::JSONObject &item, const char *key, const char *warningPrefix, bool isOptional = false); }; } // End of namespace Networking -- cgit v1.2.3