浏览代码

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 年之前
父节点
当前提交
aaf84cb10f
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 upb_msgdef *msgdef = desc->msgdef;
   upb_arena *arena = Arena_Get(&intern->arena);
-  zval *init_arr;
+  zval *init_arr = NULL;
 
   intern->desc = desc;
   intern->msg = upb_msg_new(msgdef, arena);