test/packettest.c:205: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 4):unsigned64 by call to `PACKET_get_bytes`.
Showing all 10 steps of the trace


test/packettest.c:204:17: Call
202.       PACKET pkt;
203.   
204.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
                       ^
205.               || !PACKET_get_bytes(&pkt, &bytes, 4)
206.               ||  bytes[0] != 2 || bytes[1] != 4

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:205:17: Call
203.   
204.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
205.               || !PACKET_get_bytes(&pkt, &bytes, 4)
                       ^
206.               ||  bytes[0] != 2 || bytes[1] != 4
207.               ||  bytes[2] != 6 || bytes[3] != 8

ssl/packet_locl.h:313:8: Parameter `len`
  311.    * freed
  312.    */
  313.   __owur static inline int PACKET_get_bytes(PACKET *pkt, unsigned char **data,
                ^
  314.                                             size_t len)
  315.   {

ssl/packet_locl.h:319:5: Call
  317.           return 0;
  318.   
  319.       packet_forward(pkt, len);
             ^
  320.   
  321.       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: ([0, +oo] - 4):unsigned64 by call to `PACKET_get_bytes` 
    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_bytes(unsigned char buf[BUF_LEN])\n{\n    unsigned char *bytes;\n    PACKET pkt;\n    if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)\n            || !PACKET_get_bytes(&pkt, &bytes, 4)\n            ||  bytes[0] != 2 || bytes[1] != 4\n            ||  bytes[2] != 6 || bytes[3] != 8\n            ||  PACKET_remaining(&pkt) != BUF_LEN -4\n            || !PACKET_forward(&pkt, BUF_LEN - 8)\n            || !PACKET_get_bytes(&pkt, &bytes, 4)\n            ||  bytes[0] != 0xf8 || bytes[1] != 0xfa\n            ||  bytes[2] != 0xfc || bytes[3] != 0xfe\n            ||  PACKET_remaining(&pkt)) {\n        fprintf(stderr, "test_PACKET_get_bytes() 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}']