Added Invalid Request Drop to AchievementManager Request
This fixes a crash I found in the Request function of AchievementManager where under certain conditions init_request would return an api_request with null post data, and Post would crash if it attempted to access it. Now the function aborts before the Post and returns an INVALID_REQUEST response type.
This commit is contained in:
parent
8e6e6f3c4a
commit
9778640a84
|
@ -384,6 +384,8 @@ AchievementManager::ResponseType AchievementManager::Request(
|
|||
rc_api_request_t api_request;
|
||||
Common::HttpRequest http_request;
|
||||
init_request(&api_request, &rc_request);
|
||||
if (!api_request.post_data)
|
||||
return ResponseType::INVALID_REQUEST;
|
||||
auto http_response = http_request.Post(api_request.url, api_request.post_data);
|
||||
rc_api_destroy_request(&api_request);
|
||||
if (http_response.has_value() && http_response->size() > 0)
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
{
|
||||
SUCCESS,
|
||||
MANAGER_NOT_INITIALIZED,
|
||||
INVALID_REQUEST,
|
||||
INVALID_CREDENTIALS,
|
||||
CONNECTION_FAILED,
|
||||
UNKNOWN_FAILURE
|
||||
|
|
Loading…
Reference in New Issue