Fix crashes from badly formed json responses (LL's fault)
Adds LlsdFromJsonString, an exception-free wrapper for parsing json strings LLSD objects that failed to parse through this will be the type Undefined. Fixes crashes 36, 1G, 33, 21, and 3A.
This commit is contained in:
@@ -82,7 +82,13 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
auto root = LlsdFromJson(nlohmann::json::parse(body));
|
||||
auto root = LlsdFromJsonString(body);
|
||||
if (root.isUndefined())
|
||||
{
|
||||
LL_WARNS() << "Failed to get valid json body" << LL_ENDL;
|
||||
LLWebProfile::reportImageUploadStatus(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// *TODO: 404 = not supported by the grid
|
||||
// *TODO: increase timeout or handle HTTP_INTERNAL_ERROR_* time errors.
|
||||
|
||||
Reference in New Issue
Block a user