test/wpackettest.c:348: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `WPACKET_finish`.
Showing all 12 steps of the trace


test/wpackettest.c:346:10: Call
344.       const unsigned char bytes[] = { 0xfe, 0xff };
345.   
346.       if (!TEST_true(WPACKET_init_len(&pkt, buf, 1))
                ^
347.               || !TEST_true(WPACKET_memcpy(&pkt, bytes, sizeof(bytes)))
348.               || !TEST_true(WPACKET_finish(&pkt))

ssl/packet.c:134:1: Parameter `pkt->written`
  132.   }
  133.   
  134. > int WPACKET_init_len(WPACKET *pkt, BUF_MEM *buf, size_t lenbytes)
  135.   {
  136.       /* Internal API, so should not fail */

test/wpackettest.c:347:17: Call
345.   
346.       if (!TEST_true(WPACKET_init_len(&pkt, buf, 1))
347.               || !TEST_true(WPACKET_memcpy(&pkt, bytes, sizeof(bytes)))
                       ^
348.               || !TEST_true(WPACKET_finish(&pkt))
349.               || !TEST_true(WPACKET_get_total_written(&pkt, &written))

ssl/packet.c:353:1: Parameter `pkt->written`
  351.   }
  352.   
  353. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
  354.   {
  355.       unsigned char *dest;

test/wpackettest.c:348:17: Call
346.       if (!TEST_true(WPACKET_init_len(&pkt, buf, 1))
347.               || !TEST_true(WPACKET_memcpy(&pkt, bytes, sizeof(bytes)))
348.               || !TEST_true(WPACKET_finish(&pkt))
                       ^
349.               || !TEST_true(WPACKET_get_total_written(&pkt, &written))
350.               || !TEST_mem_eq(buf->data, written, alloc, sizeof(alloc)))

ssl/packet.c:255:1: Parameter `pkt->written`
  253.   }
  254.   
  255. > int WPACKET_finish(WPACKET *pkt)
  256.   {
  257.       int ret;

ssl/packet.c:266:11: Call
  264.           return 0;
  265.   
  266.       ret = wpacket_intern_close(pkt, pkt->subs, 1);
                   ^
  267.       if (ret) {
  268.           OPENSSL_free(pkt->subs);

ssl/packet.c:188:1: <LHS trace>
186.    * (i.e. it fills in all the lengths), but doesn't actually close anything.
187.    */
188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
189.   {
190.       size_t packlen = pkt->written - sub->pwritten;

ssl/packet.c:188:1: Parameter `pkt->written`
    186.    * (i.e. it fills in all the lengths), but doesn't actually close anything.
    187.    */
    188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
    189.   {
    190.       size_t packlen = pkt->written - sub->pwritten;

ssl/packet.c:188:1: <RHS trace>
186.    * (i.e. it fills in all the lengths), but doesn't actually close anything.
187.    */
188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
189.   {
190.       size_t packlen = pkt->written - sub->pwritten;

ssl/packet.c:188:1: Parameter `sub->pwritten`
    186.    * (i.e. it fills in all the lengths), but doesn't actually close anything.
    187.    */
    188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
    189.   {
    190.       size_t packlen = pkt->written - sub->pwritten;

ssl/packet.c:190:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `WPACKET_finish` 
    188.   static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
    189.   {
    190.       size_t packlen = pkt->written - sub->pwritten;
               ^
    191.   
    192.       if (packlen == 0
