fix(legacy): Fix compile-time check of maximum protobuf message size.

pull/1857/head
Andrew Kozlik 3 years ago committed by Andrew Kozlik
parent dfd98c5164
commit 926365b64e

@ -0,0 +1 @@
Fix incorrect compile-time check of maximum protobuf message size.

@ -29,7 +29,7 @@
#define MSG_HEADER_SIZE 9
// Maximum size of an incoming protobuf-encoded message without headers.
#define MSG_IN_ENCODED_SIZE (15 * 1024)
#define MSG_IN_ENCODED_SIZE (16 * 1024)
// Maximum size of a C struct containing a decoded incoming message.
#define MSG_IN_DECODED_SIZE (15 * 1024)

@ -97,7 +97,7 @@ def handle_message(fh, fl, skipped, message):
if encoded_size:
fl.write(
f'_Static_assert({encoded_size} >= sizeof({short_name}_size), "msg buffer too small");\n'
f'_Static_assert({encoded_size} >= {short_name}_size, "msg buffer too small");\n'
)
if decoded_size:

Loading…
Cancel
Save