test/packettest.c:89: error: INTEGER_OVERFLOW_L2
  ([1, +oo] - 253):unsigned64 by call to `PACKET_forward`.
Showing all 14 steps of the trace


test/packettest.c:86:17: Call
84.       PACKET pkt;
85.   
86.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
                      ^
87.               || !PACKET_get_1(&pkt, &i)
88.               ||  i != 0x02

ssl/packet_locl.h:109:1: Parameter `pkt->remaining`
  107.    * is being used.
  108.    */
  109. > static inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, size_t len)
  110.   {
  111.       /* Sanity check for negative values. */

test/packettest.c:87:17: Call
85.   
86.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
87.               || !PACKET_get_1(&pkt, &i)
                      ^
88.               ||  i != 0x02
89.               || !PACKET_forward(&pkt, BUF_LEN - 2)

ssl/packet_locl.h:248:8: Parameter `pkt->remaining`
  246.   
  247.   /* Get 1 byte from |pkt| and store the value in |*data| */
  248.   __owur static inline int PACKET_get_1(PACKET *pkt, unsigned int *data)
                ^
  249.   {
  250.       if (!PACKET_peek_1(pkt, data))

ssl/packet_locl.h:250:10: Call
  248.   __owur static inline int PACKET_get_1(PACKET *pkt, unsigned int *data)
  249.   {
  250.       if (!PACKET_peek_1(pkt, data))
                  ^
  251.           return 0;
  252.   

ssl/packet_locl.h:237:8: Parameter `pkt->remaining`
    235.   
    236.   /* Peek ahead at 1 byte from |pkt| and store the value in |*data| */
    237.   __owur static inline int PACKET_peek_1(const PACKET *pkt, unsigned int *data)
                  ^
    238.   {
    239.       if (!PACKET_remaining(pkt))

test/packettest.c:89:17: Call
87.               || !PACKET_get_1(&pkt, &i)
88.               ||  i != 0x02
89.               || !PACKET_forward(&pkt, BUF_LEN - 2)
                      ^
90.               || !PACKET_get_1(&pkt, &i)
91.               ||  i != 0xfe

ssl/packet_locl.h:401:8: Parameter `len`
  399.   
  400.   /* Move the current reading position forward |len| bytes */
  401.   __owur static inline int PACKET_forward(PACKET *pkt, size_t len)
                ^
  402.   {
  403.       if (PACKET_remaining(pkt) < len)

ssl/packet_locl.h:406:5: Call
  404.           return 0;
  405.   
  406.       packet_forward(pkt, len);
             ^
  407.   
  408.       return 1;

ssl/packet_locl.h:79:1: <LHS trace>
77.   
78.   /* Internal unchecked shorthand; don't use outside this file. */
79. > static inline void packet_forward(PACKET *pkt, size_t len)
80.   {
81.       pkt->curr += len;

ssl/packet_locl.h:79:1: Parameter `pkt->remaining`
    77.   
    78.   /* Internal unchecked shorthand; don't use outside this file. */
    79. > static inline void packet_forward(PACKET *pkt, size_t len)
    80.   {
    81.       pkt->curr += len;

ssl/packet_locl.h:79:1: <RHS trace>
77.   
78.   /* Internal unchecked shorthand; don't use outside this file. */
79. > static inline void packet_forward(PACKET *pkt, size_t len)
80.   {
81.       pkt->curr += len;

ssl/packet_locl.h:79:1: Parameter `len`
    77.   
    78.   /* Internal unchecked shorthand; don't use outside this file. */
    79. > static inline void packet_forward(PACKET *pkt, size_t len)
    80.   {
    81.       pkt->curr += len;

ssl/packet_locl.h:82:5: Binary operation: ([1, +oo] - 253):unsigned64 by call to `PACKET_forward` 
    80.   {
    81.       pkt->curr += len;
    82.       pkt->remaining -= len;
              ^
    83.   }
    84.   

static inline void packet_forward(PACKET *pkt, size_t len)
{
    pkt->curr += len;
    pkt->remaining -= len;
}
['static int test_PACKET_get_1(unsigned char buf[BUF_LEN])\n{\n    unsigned int i;\n    PACKET pkt;\n    if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)\n            || !PACKET_get_1(&pkt, &i)\n            ||  i != 0x02\n            || !PACKET_forward(&pkt, BUF_LEN - 2)\n            || !PACKET_get_1(&pkt, &i)\n            ||  i != 0xfe\n            ||  PACKET_get_1(&pkt, &i)) {\n        fprintf(stderr, "test_PACKET_get_1() failed\\n");\n        return 0;\n    }\n    return 1;\n}', 'static inline void packet_forward(PACKET *pkt, size_t len)\n{\n    pkt->curr += len;\n    pkt->remaining -= len;\n}']