ssl/statem/statem_clnt.c:802: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [`pkt->written`, `pkt->written` + 37]):unsigned64 by call to `WPACKET_memcpy`.
Showing all 18 steps of the trace


ssl/statem/statem_clnt.c:707:10: Call
705.       SSL_SESSION *sess = s->session;
706.   
707.       if (!WPACKET_set_max_size(pkt, SSL3_RT_MAX_PLAIN_LENGTH)) {
                ^
708.           /* Should not happen */
709.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);

ssl/packet.c:303:1: Parameter `pkt->maxsize`
  301.   }
  302.   
  303. > int WPACKET_set_max_size(WPACKET *pkt, size_t maxsize)
  304.   {
  305.       WPACKET_SUB *sub;

ssl/statem/statem_clnt.c:786:10: Call
784.        * supported_versions extension for the real supported versions.
785.        */
786.       if (!WPACKET_put_bytes_u16(pkt,
                ^
787.                                  (!SSL_IS_DTLS(s)
788.                                      && s->client_version >= TLS1_3_VERSION)

ssl/packet.c:288:1: Parameter `pkt->maxsize`
  286.   }
  287.   
  288. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
  289.   {
  290.       unsigned char *data;

ssl/statem/statem_clnt.c:790:17: Call
788.                                      && s->client_version >= TLS1_3_VERSION)
789.                                  ? TLS1_2_VERSION : s->client_version)
790.               || !WPACKET_memcpy(pkt, s->s3->client_random, SSL3_RANDOM_SIZE)) {
                       ^
791.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);
792.           return 0;

ssl/packet.c:329:1: Parameter `pkt->maxsize`
  327.   }
  328.   
  329. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
  330.   {
  331.       unsigned char *dest;

ssl/statem/statem_clnt.c:801:17: Call
799.           sess_id_len = s->session->session_id_length;
800.       if (sess_id_len > sizeof(s->session->session_id)
801.               || !WPACKET_start_sub_packet_u8(pkt)
                       ^
802.               || (sess_id_len != 0 && !WPACKET_memcpy(pkt, s->session->session_id,
803.                                                       sess_id_len))

ssl/packet.c:251:1: Parameter `pkt->maxsize`
  249.   }
  250.   
  251. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
  252.   {
  253.       WPACKET_SUB *sub;

ssl/statem/statem_clnt.c:802:38: Call
800.       if (sess_id_len > sizeof(s->session->session_id)
801.               || !WPACKET_start_sub_packet_u8(pkt)
802.               || (sess_id_len != 0 && !WPACKET_memcpy(pkt, s->session->session_id,
                                            ^
803.                                                       sess_id_len))
804.               || !WPACKET_close(pkt)) {

ssl/packet.c:329:1: Parameter `pkt->maxsize`
  327.   }
  328.   
  329. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
  330.   {
  331.       unsigned char *dest;

ssl/packet.c:336:10: Call
  334.           return 1;
  335.   
  336.       if (!WPACKET_allocate_bytes(pkt, len, &dest))
                  ^
  337.           return 0;
  338.   

ssl/packet.c:15:1: Parameter `pkt->maxsize`
    13.   #define DEFAULT_BUF_SIZE    256
    14.   
    15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
    16.   {
    17.       if (!WPACKET_reserve_bytes(pkt, len, allocbytes))

ssl/packet.c:17:10: Call
    15.   int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
    16.   {
    17.       if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
                   ^
    18.           return 0;
    19.   

ssl/packet.c:39:1: <LHS trace>
37.                        ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.   
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40.   {
41.       /* Internal API, so should not fail */

ssl/packet.c:39:1: Parameter `pkt->maxsize`
      37.                        ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
      38.   
      39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
      40.   {
      41.       /* Internal API, so should not fail */

ssl/packet.c:39:1: <RHS trace>
37.                        ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.   
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40.   {
41.       /* Internal API, so should not fail */

ssl/packet.c:39:1: Parameter `pkt->written`
      37.                        ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
      38.   
      39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
      40.   {
      41.       /* Internal API, so should not fail */

ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 37]):unsigned64 by call to `WPACKET_memcpy` 
      44.           return 0;
      45.   
      46.       if (pkt->maxsize - pkt->written < len)
                    ^
      47.           return 0;
      48.   
