diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-05-15 12:44:30 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-05-15 12:44:30 -0700 |
commit | a8f719c98dd8ec60cf7e33ae44355a2b9371f89c (patch) | |
tree | bb7a0ae0dfd24ef8483dda02b3690cd85c06b17e | |
parent | 68d38107660ddf62d9e4c60250862b7eca099048 (diff) |
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) \ { \ |