test/bad_dtls_test.c:397: error: INTEGER_OVERFLOW_L2
  ([2, +oo] - 10):unsigned64 by call to `PACKET_forward`.
Showing all 18 steps of the trace


test/bad_dtls_test.c:387:10: Call
385.   
386.       len = BIO_get_mem_data(wbio, (char **)&data);
387.       if (!PACKET_buf_init(&pkt, data, len))
                ^
388.           return 0;
389.   

ssl/packet_locl.h:72:8: Parameter `pkt->remaining`
  70.    * is being used.
  71.    */
  72.   __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
               ^
  73.                                                 const unsigned char *buf,
  74.                                                 size_t len)

test/bad_dtls_test.c:391:10: Call
389.   
390.       /* Check record header type */
391.       if (!PACKET_get_1(&pkt, &u) || u != SSL3_RT_CHANGE_CIPHER_SPEC)
                ^
392.           return 0;
393.       /* Version */

ssl/packet_locl.h:235:8: Parameter `pkt->remaining`
  233.   
  234.   /* Get 1 byte from |pkt| and store the value in |*data| */
  235.   __owur static ossl_inline int PACKET_get_1(PACKET *pkt, unsigned int *data)
                ^
  236.   {
  237.       if (!PACKET_peek_1(pkt, data))

ssl/packet_locl.h:237:10: Call
  235.   __owur static ossl_inline int PACKET_get_1(PACKET *pkt, unsigned int *data)
  236.   {
  237.       if (!PACKET_peek_1(pkt, data))
                  ^
  238.           return 0;
  239.   

ssl/packet_locl.h:223:8: Parameter `pkt->remaining`
    221.   
    222.   /* Peek ahead at 1 byte from |pkt| and store the value in |*data| */
    223.   __owur static ossl_inline int PACKET_peek_1(const PACKET *pkt,
                  ^
    224.                                               unsigned int *data)
    225.   {

test/bad_dtls_test.c:394:10: Call
392.           return 0;
393.       /* Version */
394.       if (!PACKET_get_net_2(&pkt, &u) || u != DTLS1_BAD_VER)
                ^
395.           return 0;
396.       /* Skip the rest of the record header */

ssl/packet_locl.h:153:8: Parameter `pkt->remaining`
  151.   /* Equivalent of n2s */
  152.   /* Get 2 bytes in network order from |pkt| and store the value in |*data| */
  153.   __owur static ossl_inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)
                ^
  154.   {
  155.       if (!PACKET_peek_net_2(pkt, data))

ssl/packet_locl.h:155:10: Call
  153.   __owur static ossl_inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)
  154.   {
  155.       if (!PACKET_peek_net_2(pkt, data))
                  ^
  156.           return 0;
  157.   

ssl/packet_locl.h:139:8: Parameter `pkt->remaining`
    137.    * |*data|
    138.    */
    139.   __owur static ossl_inline int PACKET_peek_net_2(const PACKET *pkt,
                  ^
    140.                                                   unsigned int *data)
    141.   {

test/bad_dtls_test.c:397:10: Call
395.           return 0;
396.       /* Skip the rest of the record header */
397.       if (!PACKET_forward(&pkt, DTLS1_RT_HEADER_LENGTH - 3))
                ^
398.           return 0;
399.   

ssl/packet_locl.h:419:8: Parameter `len`
  417.   
  418.   /* Move the current reading position forward |len| bytes */
  419.   __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
                ^
  420.   {
  421.       if (PACKET_remaining(pkt) < len)

ssl/packet_locl.h:424:5: Call
  422.           return 0;
  423.   
  424.       packet_forward(pkt, len);
             ^
  425.   
  426.       return 1;

ssl/packet_locl.h:33:1: <LHS trace>
31.   
32.   /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34.   {
35.       pkt->curr += len;

ssl/packet_locl.h:33:1: Parameter `pkt->remaining`
    31.   
    32.   /* Internal unchecked shorthand; don't use outside this file. */
    33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
    34.   {
    35.       pkt->curr += len;

ssl/packet_locl.h:33:1: <RHS trace>
31.   
32.   /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34.   {
35.       pkt->curr += len;

ssl/packet_locl.h:33:1: Parameter `len`
    31.   
    32.   /* Internal unchecked shorthand; don't use outside this file. */
    33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
    34.   {
    35.       pkt->curr += len;

ssl/packet_locl.h:36:5: Binary operation: ([2, +oo] - 10):unsigned64 by call to `PACKET_forward` 
    34.   {
    35.       pkt->curr += len;
    36.       pkt->remaining -= len;
              ^
    37.   }
    38.   

static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
    pkt->curr += len;
    pkt->remaining -= len;
}
['static int validate_ccs(BIO *wbio)\n{\n    PACKET pkt;\n    long len;\n    unsigned char *data;\n    unsigned int u;\n    len = BIO_get_mem_data(wbio, (char **)&data);\n    if (!PACKET_buf_init(&pkt, data, len))\n        return 0;\n    if (!PACKET_get_1(&pkt, &u) || u != SSL3_RT_CHANGE_CIPHER_SPEC)\n        return 0;\n    if (!PACKET_get_net_2(&pkt, &u) || u != DTLS1_BAD_VER)\n        return 0;\n    if (!PACKET_forward(&pkt, DTLS1_RT_HEADER_LENGTH - 3))\n        return 0;\n    if (!PACKET_get_1(&pkt, &u) || u != SSL3_MT_CCS)\n        return 0;\n    if (!PACKET_get_net_2(&pkt, &u) || u != 0x0002)\n        return 0;\n    if (!PACKET_get_1(&pkt, &u) || u != SSL3_RT_HANDSHAKE)\n        return 0;\n    if (!PACKET_get_net_2(&pkt, &u) || u != DTLS1_BAD_VER)\n        return 0;\n    if (!PACKET_get_net_2(&pkt, &u) || u != 0x0001)\n        return 0;\n    return 1;\n}', 'static ossl_inline void packet_forward(PACKET *pkt, size_t len)\n{\n    pkt->curr += len;\n    pkt->remaining -= len;\n}']