From 119d0fd396a9cb3b6e7067f8102694f1485e2e94 Mon Sep 17 00:00:00 2001 From: Justin DeMartino Date: Fri, 24 Feb 2017 20:55:14 -0800 Subject: Fix infinite loop in pb_check_proto3_default_value - Occurs with proto3, PB_FIELD_16BIT and submessage > 255 bytes - Add test case for PB_FIELD_16BIT and proto3 --- pb_encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pb_encode.c') diff --git a/pb_encode.c b/pb_encode.c index cd731dcf..0d6e1e7e 100644 --- a/pb_encode.c +++ b/pb_encode.c @@ -228,7 +228,7 @@ static bool pb_check_proto3_default_value(const pb_field_t *field, const void *p * pb_enc_varint(). (Casting to char* is safe with regards * to C strict aliasing rules.) */ - uint_fast8_t i; + pb_size_t i; const char *p = (const char*)pData; for (i = 0; i < field->data_size; i++) { -- cgit 1.2.3-korg