From 0a9b07ba86cd4aa620d0b061a56d239f40795e39 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Thu, 1 Jun 2017 12:34:06 -0700 Subject: [PATCH] Fix upb load descriptor when no messages defined in prorto. --- upb/def.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/upb/def.c b/upb/def.c index 01bbe5f800..ceaced2fea 100644 --- a/upb/def.c +++ b/upb/def.c @@ -2309,6 +2309,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) {