ssl/statem/extensions_clnt.c:728: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `add_key_share`.
Showing all 14 steps of the trace


ssl/statem/extensions_clnt.c:697:17: Call
695.               || !WPACKET_start_sub_packet_u16(pkt)
696.                  /* KeyShare list sub-packet */
697.               || !WPACKET_start_sub_packet_u16(pkt)) {
                       ^
698.           SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CTOS_KEY_SHARE,
699.                    ERR_R_INTERNAL_ERROR);

crypto/packet.c:292:1: Parameter `pkt->buf->length`
  290.   }
  291.   
  292. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
  293.   {
  294.       WPACKET_SUB *sub;

ssl/statem/extensions_clnt.c:728:10: Call
726.       }
727.   
728.       if (!add_key_share(s, pkt, curve_id)) {
                ^
729.           /* SSLfatal() already called */
730.           return EXT_RETURN_FAIL;

ssl/statem/extensions_clnt.c:625:1: Parameter `pkt->written`
  623.   
  624.   #ifndef OPENSSL_NO_TLS1_3
  625. > static int add_key_share(SSL *s, WPACKET *pkt, unsigned int curve_id)
  626.   {
  627.       unsigned char *encoded_point = NULL;

ssl/statem/extensions_clnt.c:658:10: Call
  656.   
  657.       /* Create KeyShareEntry */
  658.       if (!WPACKET_put_bytes_u16(pkt, curve_id)
                  ^
  659.               || !WPACKET_sub_memcpy_u16(pkt, encoded_point, encodedlen)) {
  660.           SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_ADD_KEY_SHARE,

crypto/packet.c:329:1: Parameter `pkt->written`
    327.   }
    328.   
    329. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
    330.   {
    331.       unsigned char *data;

crypto/packet.c:335:17: Call
    333.       /* Internal API, so should not fail */
    334.       if (!ossl_assert(size <= sizeof(unsigned int))
    335.               || !WPACKET_allocate_bytes(pkt, size, &data)
                           ^
    336.               || !put_value(data, val, size))
    337.           return 0;

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

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

crypto/packet.c:43:1: <LHS trace>
41.                           : NULL))
42.   
43. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
44.   {
45.       /* Internal API, so should not fail */

crypto/packet.c:43:1: Parameter `pkt->buf->length`
        41.                           : NULL))
        42.   
        43. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
        44.   {
        45.       /* Internal API, so should not fail */

crypto/packet.c:43:1: <RHS trace>
41.                           : NULL))
42.   
43. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
44.   {
45.       /* Internal API, so should not fail */

crypto/packet.c:43:1: Parameter `len`
        41.                           : NULL))
        42.   
        43. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
        44.   {
        45.       /* Internal API, so should not fail */

crypto/packet.c:52:30: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `add_key_share` 
        50.           return 0;
        51.   
        52.       if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
                                           ^
        53.           size_t newlen;
        54.           size_t reflen;
