ssl/statem/statem_srvr.c:3790: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [`pkt->written`, `pkt->written` + 1]):unsigned64 by call to `ssl3_output_cert_chain`.
Showing all 13 steps of the trace


ssl/statem/statem_srvr.c:3771:1: Parameter `pkt->written`
3769.   }
3770.   
3771. > int tls_construct_server_certificate(SSL *s, WPACKET *pkt)
3772.   {
3773.       CERT_PKEY *cpk = s->s3.tmp.cert;

ssl/statem/statem_srvr.c:3790:10: Call
3788.           return 0;
3789.       }
3790.       if (!ssl3_output_cert_chain(s, pkt, cpk)) {
                 ^
3791.           /* SSLfatal() already called */
3792.           return 0;

ssl/statem/statem_lib.c:1001:1: Parameter `pkt->written`
  999.   }
  1000.   
  1001. > unsigned long ssl3_output_cert_chain(SSL *s, WPACKET *pkt, CERT_PKEY *cpk)
  1002.   {
  1003.       if (!WPACKET_start_sub_packet_u24(pkt)) {

ssl/statem/statem_lib.c:1003:10: Call
  1001.   unsigned long ssl3_output_cert_chain(SSL *s, WPACKET *pkt, CERT_PKEY *cpk)
  1002.   {
  1003.       if (!WPACKET_start_sub_packet_u24(pkt)) {
                   ^
  1004.           SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_OUTPUT_CERT_CHAIN,
  1005.                    ERR_R_INTERNAL_ERROR);

ssl/packet.c:272:1: Parameter `pkt->written`
    270.   }
    271.   
    272. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
    273.   {
    274.       WPACKET_SUB *sub;

ssl/packet.c:296:10: Call
    294.       }
    295.   
    296.       if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
                    ^
    297.           return 0;
    298.       /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */

ssl/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))

ssl/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.   

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

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

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

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

ssl/packet.c:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 1]):unsigned64 by call to `ssl3_output_cert_chain` 
        47.           return 0;
        48.   
        49.       if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) {
                                                 ^
        50.           size_t newlen;
        51.           size_t reflen;
