protobuf-c/protobuf-c.c: prevent possible overflow on 64-bit systems

(fixes #106)
This commit is contained in:
Nick Galbreath 2013-12-17 05:26:44 +00:00 committed by Ilya Lipnitskiy
parent b915eed32f
commit c1ff5d6bad

View File

@ -2248,7 +2248,7 @@ protobuf_c_message_init_generic (const ProtobufCMessageDescriptor *desc,
choose the number so that we would overflow if we needed
a slab larger than provided. */
#define MAX_SCANNED_MEMBER_SLAB \
(sizeof(void*)*8 - 1 \
(sizeof(unsigned int)*8 - 1 \
- BOUND_SIZEOF_SCANNED_MEMBER_LOG2 \
- FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2)