From 93aaf99347f84dc4b79689212ecc4f1b6dc74670 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Wed, 7 Mar 2018 22:50:22 +0000 Subject: Fix parsing sub-message field. Buffer start place needs to be adjusted before parsing sub-message. --- upb/decode.c | 1 + 1 file changed, 1 insertion(+) (limited to 'upb') diff --git a/upb/decode.c b/upb/decode.c index 4340a90..8d685a2 100644 --- a/upb/decode.c +++ b/upb/decode.c @@ -477,6 +477,7 @@ static bool upb_decode_delimitedfield(upb_decstate *d, upb_decframe *frame, } case UPB_DESCRIPTOR_TYPE_MESSAGE: CHK(val.size <= (size_t)(frame->limit - val.data)); + d->ptr -= val.size; CHK(upb_decode_submsg(d, frame, val.data + val.size, field, 0)); break; default: -- cgit v1.2.3