diff --git a/firmware/protob/messages.pb.c b/firmware/protob/messages.pb.c index c72e3073c3..c16857f90d 100644 --- a/firmware/protob/messages.pb.c +++ b/firmware/protob/messages.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.2.9.2 */ +/* Generated by nanopb-0.2.9.3 */ #include "messages.pb.h" diff --git a/firmware/protob/messages.pb.h b/firmware/protob/messages.pb.h index 2b814ba8fe..aed732c41d 100644 --- a/firmware/protob/messages.pb.h +++ b/firmware/protob/messages.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.2.9.2 */ +/* Generated by nanopb-0.2.9.3 */ #ifndef _PB_MESSAGES_PB_H_ #define _PB_MESSAGES_PB_H_ diff --git a/firmware/protob/pb.h b/firmware/protob/pb.h index 70911e4dbd..dedcfe46af 100644 --- a/firmware/protob/pb.h +++ b/firmware/protob/pb.h @@ -46,7 +46,7 @@ /* Version of the nanopb library. Just in case you want to check it in * your own program. */ -#define NANOPB_VERSION nanopb-0.2.9.2 +#define NANOPB_VERSION nanopb-0.2.9.3 /* Include all the system headers needed by nanopb. You will need the * definitions of the following: diff --git a/firmware/protob/pb_decode.c b/firmware/protob/pb_decode.c index 9edc8b3abb..c97ffde222 100644 --- a/firmware/protob/pb_decode.c +++ b/firmware/protob/pb_decode.c @@ -992,6 +992,12 @@ static void pb_release_single_field(const pb_field_iterator_t *iter) if (PB_HTYPE(type) == PB_HTYPE_REPEATED) { count = *(pb_size_t*)iter->pSize; + + if (PB_ATYPE(type) == PB_ATYPE_STATIC && count > iter->pos->array_size) + { + /* Protect against corrupted _count fields */ + count = iter->pos->array_size; + } } if (pItem) diff --git a/firmware/protob/storage.pb.c b/firmware/protob/storage.pb.c index 67f1619a8f..fd33888094 100644 --- a/firmware/protob/storage.pb.c +++ b/firmware/protob/storage.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.2.9.2 */ +/* Generated by nanopb-0.2.9.3 */ #include "storage.pb.h" diff --git a/firmware/protob/storage.pb.h b/firmware/protob/storage.pb.h index c5d942eb90..7e8f5840ff 100644 --- a/firmware/protob/storage.pb.h +++ b/firmware/protob/storage.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.2.9.2 */ +/* Generated by nanopb-0.2.9.3 */ #ifndef _PB_STORAGE_PB_H_ #define _PB_STORAGE_PB_H_ diff --git a/firmware/protob/types.pb.c b/firmware/protob/types.pb.c index a00a97dab8..89c11a18c8 100644 --- a/firmware/protob/types.pb.c +++ b/firmware/protob/types.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.2.9.2 */ +/* Generated by nanopb-0.2.9.3 */ #include "types.pb.h" diff --git a/firmware/protob/types.pb.h b/firmware/protob/types.pb.h index beff78c031..e8318e1932 100644 --- a/firmware/protob/types.pb.h +++ b/firmware/protob/types.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.2.9.2 */ +/* Generated by nanopb-0.2.9.3 */ #ifndef _PB_TYPES_PB_H_ #define _PB_TYPES_PB_H_