aboutsummaryrefslogtreecommitdiffhomepage
path: root/php
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-05-11 13:56:05 -0700
committerGravatar GitHub <noreply@github.com>2017-05-11 13:56:05 -0700
commitde6ae7d4ebea9bf15ab3ca139a00c975826450bf (patch)
tree7232263580b5bc89b50bb62f3a5ba1fac149b0dc /php
parent22319315df18526277873058f79cf69e77d8b4a2 (diff)
Fix upb load descriptor when no messages defined in prorto. (#3080)
Diffstat (limited to 'php')
-rw-r--r--php/ext/google/protobuf/upb.c3
1 files changed, 3 insertions, 0 deletions
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) {