diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-11 14:21:10 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-11 14:21:10 +0300 |
commit | 61325c65c5b8549fbc05144ba533fe60ddd7853b (patch) | |
tree | 6876bd4387007b276d8ca4fc3c0ea5ec76822409 /libs/libjson/src | |
parent | ebf83d38be5ad294e3ed47bc33f947cee7b1a92f (diff) |
fixes #4643 (Newest Update crashes miranda)
Diffstat (limited to 'libs/libjson/src')
-rw-r--r-- | libs/libjson/src/libJSON.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/libjson/src/libJSON.cpp b/libs/libjson/src/libJSON.cpp index 3dd7544afa..e52af2b6db 100644 --- a/libs/libjson/src/libJSON.cpp +++ b/libs/libjson/src/libJSON.cpp @@ -39,6 +39,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "JSONWorker.h"
+#include "m_netlib.h"
+
#ifdef JSON_MEMORY_MANAGE
auto_expand StringHandler;
auto_expand_node NodeHandler;
@@ -93,7 +95,13 @@ JSONNode JSONNode::parse(const json_char *str) if (str == nullptr)
return JSONNode();
- return JSONWorker::parse(str);
+ try {
+ return JSONWorker::parse(str);
+ }
+ catch (...) {
+ Netlib_Logf(0, "Exception in uncrunching JSON from string: %s", str);
+ }
+ return JSONNode();
}
LIBJSON_DLL(JSONNode*) json_parse(const json_char *json) {
|