Added checks for OOM conditions.

pull/13171/head
Joshua Haberman 6 years ago
parent 68d3810766
commit a8f719c98d
  1. 2
      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) \
{ \

Loading…
Cancel
Save