Skip to content

Commit

Permalink
read_property() handler is not supposed to return NULL
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tony2001 committed Mar 2, 2021
1 parent 85e5204 commit 2e7771d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/ext/google/protobuf/message.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2e7771d

Please sign in to comment.