Browse Source

Bugfix for when message constructor has no argument. (#7660)

This fixes the user issue: https://github.com/protocolbuffers/protobuf/issues/7611#issuecomment-647025031
Joshua Haberman 5 years ago
parent
commit
aaf84cb10f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      php/ext/google/protobuf2/message.c

+ 1 - 1
php/ext/google/protobuf2/message.c

@@ -366,7 +366,7 @@ PHP_METHOD(Message, __construct) {
   const Descriptor* desc = Descriptor_GetFromClassEntry(Z_OBJCE_P(getThis()));
   const Descriptor* desc = Descriptor_GetFromClassEntry(Z_OBJCE_P(getThis()));
   const upb_msgdef *msgdef = desc->msgdef;
   const upb_msgdef *msgdef = desc->msgdef;
   upb_arena *arena = Arena_Get(&intern->arena);
   upb_arena *arena = Arena_Get(&intern->arena);
-  zval *init_arr;
+  zval *init_arr = NULL;
 
 
   intern->desc = desc;
   intern->desc = desc;
   intern->msg = upb_msg_new(msgdef, arena);
   intern->msg = upb_msg_new(msgdef, arena);