aboutsummaryrefslogtreecommitdiffstats
path: root/pb_encode.c
diff options
context:
space:
mode:
authorJustin DeMartino <jdemarti@gmail.com>2017-02-24 20:55:14 -0800
committerJustin DeMartino <jdemarti@gmail.com>2017-02-24 21:01:43 -0800
commit119d0fd396a9cb3b6e7067f8102694f1485e2e94 (patch)
treeaa1c2f4b4e781e236cc5f122545d9e45f6f951c9 /pb_encode.c
parent60299d9270c1e7114a5aec864f192269ba6731dd (diff)
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
Diffstat (limited to 'pb_encode.c')
-rw-r--r--pb_encode.c2
1 files changed, 1 insertions, 1 deletions
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++)
{