read_property() handler is not supposed to return NULL

NULL is never expected as a result of read_property() handler,
it should return &EG(uninitialized_zval) if there is no such property in
the object
pull/8362/head
Antony Dovgal 4 years ago
parent 85e5204517
commit 2e7771d7a0
  1. 2
      php/ext/google/protobuf/message.c

@ -334,7 +334,7 @@ static zval *Message_read_property(PROTO_VAL *obj, PROTO_STR *member,
Message* intern = PROTO_VAL_P(obj);
const upb_fielddef *f = get_field(intern, member);
if (!f) return NULL;
if (!f) return &EG(uninitialized_zval);
Message_get(intern, f, rv);
return rv;
}

Loading…
Cancel
Save