Commit 1da9ffe3 authored by Felix Jendrusch's avatar Felix Jendrusch

Check return value on write of raw pointer

parent 38508e9b
...@@ -942,7 +942,10 @@ static void GPBWriteRawLittleEndian64(GPBOutputBufferState *state, ...@@ -942,7 +942,10 @@ static void GPBWriteRawLittleEndian64(GPBOutputBufferState *state,
state_.position = length; state_.position = length;
} else { } else {
// Write is very big. Let's do it all at once. // Write is very big. Let's do it all at once.
[state_.output write:((uint8_t *)value) + offset maxLength:length]; NSInteger written = [state_.output write:((uint8_t *)value) + offset maxLength:length];
if (written != (NSInteger)length) {
[NSException raise:GPBCodedOutputStreamException_WriteFailed format:@""];
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment