diff options
author | Richard Levitte <levitte@openssl.org> | 2016-01-02 19:19:00 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-01-02 21:11:02 +0100 |
commit | 1de1d7689a81f2a3ed3348926e6a31ef79a2bc15 (patch) | |
tree | 75f33acb510fe4a3a7a05191eee9689bc0c5759c /ssl | |
parent | 6aa0ba4bb2833b1e0d6ae98c54c79bfed8257c3a (diff) |
Instead of a local hack, implement SIZE_MAX in numbers.h if it's missing
Reviewed-by: Stephen Henson <steve@openssl.org>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/packet_locl.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h index 48a5f3d7dc..ed7c1ca129 100644 --- a/ssl/packet_locl.h +++ b/ssl/packet_locl.h @@ -65,6 +65,8 @@ # include <openssl/crypto.h> # include <openssl/e_os2.h> +# include "internal/numbers.h" + # ifdef __cplusplus extern "C" { # endif @@ -111,13 +113,8 @@ __owur static ossl_inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, size_t len) { /* Sanity check for negative values. */ -#ifdef SIZE_MAX if (len > (size_t)(SIZE_MAX / 2)) return 0; -#else - if (len > ((size_t)2 << (sizeof(size_t) * 8 - 1))) - return 0; -#endif pkt->curr = buf; pkt->remaining = len; |