From de6ae7d4ebea9bf15ab3ca139a00c975826450bf Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 11 May 2017 13:56:05 -0700 Subject: Fix upb load descriptor when no messages defined in prorto. (#3080) --- php/ext/google/protobuf/upb.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'php') diff --git a/php/ext/google/protobuf/upb.c b/php/ext/google/protobuf/upb.c index 70983016..760848e8 100644 --- a/php/ext/google/protobuf/upb.c +++ b/php/ext/google/protobuf/upb.c @@ -2290,6 +2290,9 @@ bool upb_symtab_addfile(upb_symtab *s, upb_filedef *file, upb_status *status) { bool ret; n = upb_filedef_defcount(file); + if (n == 0) { + return true; + } defs = upb_gmalloc(sizeof(*defs) * n); if (defs == NULL) { -- cgit v1.2.3