Skip to content

Commit 087e48b

Browse files
authored
Fix recent analyzer regressions (#3587)
1 parent dbd960d commit 087e48b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Firebase/Messaging/FIRMessagingCodedInputStream.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static BOOL ReadRawByte(BufferState *state, int8_t *output) {
3737
if (state == NULL || output == NULL) {
3838
FIRMessagingLoggerDebug(kFIRMessagingCodeInputStreamInvalidParameters, @"Invalid parameters.");
3939
}
40-
if (CheckSize(state, sizeof(int8_t))) {
40+
if (output != nil && CheckSize(state, sizeof(int8_t))) {
4141
*output = ((int8_t *)state->bytes)[state->bufferPos++];
4242
return YES;
4343
}
@@ -47,6 +47,7 @@ static BOOL ReadRawByte(BufferState *state, int8_t *output) {
4747
static BOOL ReadRawVarInt32(BufferState *state, int32_t *output) {
4848
if (state == NULL || output == NULL) {
4949
FIRMessagingLoggerDebug(kFIRMessagingCodeInputStreamInvalidParameters, @"Invalid parameters.");
50+
return NO;
5051
}
5152
int8_t tmp = 0;
5253
if (!ReadRawByte(state, &tmp)) {

0 commit comments

Comments
 (0)