Merge pull request #498 from haberman/grpc-fixes

Fix NULL + 0 UBSAN error
pull/13171/head
Joshua Haberman 3 years ago committed by GitHub
commit 5c89d4d8d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      upb/encode.c

@ -538,8 +538,8 @@ static void encode_message(upb_encstate* e, const upb_Message* msg,
* other. */
size_t ext_count;
const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &ext_count);
const upb_Message_Extension* end = ext + ext_count;
if (ext_count) {
const upb_Message_Extension* end = ext + ext_count;
for (; ext != end; ext++) {
if (UPB_UNLIKELY(m->ext == upb_ExtMode_IsMessageSet)) {
encode_msgset_item(e, ext);

Loading…
Cancel
Save