aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec
diff options
context:
space:
mode:
authorGravatar Felix Jendrusch <felix@felixjendrusch.is>2018-03-08 16:20:37 +0100
committerGravatar Felix Jendrusch <felix@felixjendrusch.is>2018-03-08 16:20:37 +0100
commit1da9ffe39496e59f439b126a232b7ae18a634aee (patch)
treee47e7c98dedc22b1bc4bd033db19d2970f2e0edf /objectivec
parent38508e9bbbc7afde7cfd42ae5a93d78c3c051378 (diff)
Check return value on write of raw pointer
Diffstat (limited to 'objectivec')
-rw-r--r--objectivec/GPBCodedOutputStream.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/objectivec/GPBCodedOutputStream.m b/objectivec/GPBCodedOutputStream.m
index f832e8a6..b846c2fc 100644
--- a/objectivec/GPBCodedOutputStream.m
+++ b/objectivec/GPBCodedOutputStream.m
@@ -942,7 +942,10 @@ static void GPBWriteRawLittleEndian64(GPBOutputBufferState *state,
state_.position = length;
} else {
// 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:@""];
+ }
}
}
}