File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 22
22
23
23
#include " app/rest/response.h"
24
24
#include " app/src/assert.h"
25
+ #include " app/src/log.h"
25
26
#include " flatbuffers/idl.h"
26
27
#include " flatbuffers/stl_emulation.h"
27
28
@@ -74,12 +75,24 @@ class ResponseJson : public Response {
74
75
// Parse and verify JSON string in body. FlatBuffer parser does not support
75
76
// online parsing. So we only parse the body when we get everything.
76
77
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
+
78
86
const flatbuffers::FlatBufferBuilder& builder = parser_->builder_ ;
79
87
flatbuffers::Verifier verifier (builder.GetBufferPointer (),
80
88
builder.GetSize ());
81
89
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
+ }
83
96
84
97
// UnPack application data object from FlatBuffer.
85
98
const FbsType* body_fbs =
Original file line number Diff line number Diff line change @@ -576,6 +576,9 @@ code.
576
576
- Messaging (Android): Fixes an issue to receive token when
577
577
initialize the app.
578
578
([ #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 ) ).
579
582
580
583
### 8.5.0
581
584
- Changes
You can’t perform that action at this time.
0 commit comments