File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 2222
2323#include " app/rest/response.h"
2424#include " app/src/assert.h"
25+ #include " app/src/log.h"
2526#include " flatbuffers/idl.h"
2627#include " flatbuffers/stl_emulation.h"
2728
@@ -74,12 +75,24 @@ class ResponseJson : public Response {
7475 // Parse and verify JSON string in body. FlatBuffer parser does not support
7576 // online parsing. So we only parse the body when we get everything.
7677 bool parse_status = parser_->Parse (GetBody ());
77- FIREBASE_ASSERT_RETURN_VOID (parse_status);
78+ if (!parse_status) {
79+ LogError (" flatbuffers::Parser::Parse() failed: %s" ,
80+ parser_->error_ .c_str ());
81+ application_data_.reset (new FbsTypeT ());
82+ Response::MarkCompleted ();
83+ return ;
84+ }
85+
7886 const flatbuffers::FlatBufferBuilder& builder = parser_->builder_ ;
7987 flatbuffers::Verifier verifier (builder.GetBufferPointer (),
8088 builder.GetSize ());
8189 bool verify_status = verifier.VerifyBuffer <FbsType>(nullptr );
82- FIREBASE_ASSERT_RETURN_VOID (verify_status);
90+ if (!verify_status) {
91+ LogError (" flatbuffers::Verifier::VerifyBuffer() failed" );
92+ application_data_.reset (new FbsTypeT ());
93+ Response::MarkCompleted ();
94+ return ;
95+ }
8396
8497 // UnPack application data object from FlatBuffer.
8598 const FbsType* body_fbs =
Original file line number Diff line number Diff line change @@ -576,6 +576,9 @@ code.
576576 - Messaging (Android): Fixes an issue to receive token when
577577 initialize the app.
578578 ([ #667 ] ( https://github.com/firebase/firebase-cpp-sdk/pull/667 ) ).
579+ - Auth (Desktop): Fix a crash that would occur if parsing the JSON
580+ response from the server failed
581+ ([ #692 ] ( https://github.com/firebase/firebase-cpp-sdk/pull/692 ) ).
579582
580583### 8.5.0
581584- Changes
You can’t perform that action at this time.
0 commit comments