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


test/wpackettest.c:277:17: Call
275.       /* Repeat above test but only abandon a sub-packet */
276.       if (!TEST_true(WPACKET_init_len(&pkt, buf, 1))
277.               || !TEST_true(WPACKET_start_sub_packet_u8(&pkt))
                       ^
278.               || !TEST_true(WPACKET_set_flags(&pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH))
279.               || !TEST_true(WPACKET_close(&pkt))

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

crypto/packet.c:289:5: Assignment
  287.       pkt->subs = sub;
  288.       sub->pwritten = pkt->written + lenbytes;
  289.       sub->lenbytes = lenbytes;
             ^
  290.   
  291.       if (lenbytes == 0) {

test/wpackettest.c:279:17: Call
277.               || !TEST_true(WPACKET_start_sub_packet_u8(&pkt))
278.               || !TEST_true(WPACKET_set_flags(&pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH))
279.               || !TEST_true(WPACKET_close(&pkt))
                       ^
280.               || !TEST_true(WPACKET_finish(&pkt))
281.               || !TEST_true(WPACKET_get_total_written(&pkt, &written))

crypto/packet.c:240:1: Parameter `pkt->curr`
  238.   }
  239.   
  240. > int WPACKET_close(WPACKET *pkt)
  241.   {
  242.       /*

test/wpackettest.c:280:17: Call
278.               || !TEST_true(WPACKET_set_flags(&pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH))
279.               || !TEST_true(WPACKET_close(&pkt))
280.               || !TEST_true(WPACKET_finish(&pkt))
                       ^
281.               || !TEST_true(WPACKET_get_total_written(&pkt, &written))
282.               || !TEST_mem_eq(buf->data, written, empty, sizeof(empty)))

crypto/packet.c:252:1: Parameter `pkt->curr`
  250.   }
  251.   
  252. > int WPACKET_finish(WPACKET *pkt)
  253.   {
  254.       int ret;

crypto/packet.c:263:11: Call
  261.           return 0;
  262.   
  263.       ret = wpacket_intern_close(pkt, pkt->subs, 1);
                   ^
  264.       if (ret) {
  265.           OPENSSL_free(pkt->subs);

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

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

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

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

crypto/packet.c:201:13: Binary operation: ([0, +oo] - [0, 1]):unsigned64 by call to `WPACKET_finish` 
    199.   
    200.           /* Deallocate any bytes allocated for the length of the WPACKET */
    201.           if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
                       ^
    202.               pkt->written -= sub->lenbytes;
    203.               pkt->curr -= sub->lenbytes;
