From cfd5a20e48f99241b6753519556690abf6b1e3f3 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 14 Sep 2012 16:14:38 -0700 Subject: [PATCH] make static buffers length 1 (zero may not be supported) unless LARGE_STATIC, SNIFFER, or DTLS --- cyassl/internal.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cyassl/internal.h b/cyassl/internal.h index 29092bc99..6150de77c 100644 --- a/cyassl/internal.h +++ b/cyassl/internal.h @@ -621,8 +621,14 @@ enum { The length (in bytes) of the following TLSPlaintext.fragment. The length should not exceed 2^14. */ -#define STATIC_BUFFER_LEN RECORD_HEADER_SZ + RECORD_SIZE + COMP_EXTRA + \ - MTU_EXTRA + MAX_MSG_EXTRA +#if defined(LARGE_STATIC_BUFFERS) || defined(CYASSL_SNIFFER) || \ + defined(CYASSL_DTLS) + #define STATIC_BUFFER_LEN RECORD_HEADER_SZ + RECORD_SIZE + COMP_EXTRA + \ + MTU_EXTRA + MAX_MSG_EXTRA +#else + /* zero length arrays may not be supported */ + #define STATIC_BUFFER_LEN 1 +#endif typedef struct { word32 length; /* total buffer length used */