diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-05-15 15:17:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 15:17:56 -0500 |
commit | d5af87d06bbe3abad66970ce9c7ae0a7de8bb3c6 (patch) | |
tree | bb7a0ae0dfd24ef8483dda02b3690cd85c06b17e | |
parent | 68d38107660ddf62d9e4c60250862b7eca099048 (diff) | |
parent | a8f719c98dd8ec60cf7e33ae44355a2b9371f89c (diff) |
Merge pull request #168 from haberman/bugfix
Added checks for OOM conditions.
-rw-r--r-- | upb/decode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/upb/decode.c b/upb/decode.c index 79e1d6d..275f26c 100644 --- a/upb/decode.c +++ b/upb/decode.c @@ -249,6 +249,7 @@ static bool upb_decode_addval(upb_decframe *frame, if (field->label == UPB_LABEL_REPEATED) { arr = upb_getorcreatearr(frame, field); + CHK(arr); field_mem = upb_array_reserve(arr, 1, size); CHK(field_mem); } @@ -382,6 +383,7 @@ static bool upb_decode_toarray(upb_decstate *d, upb_decframe *frame, const upb_msglayout_field *field, upb_strview val) { upb_array *arr = upb_getorcreatearr(frame, field); + CHK(arr); #define VARINT_CASE(ctype, decode) \ { \ |