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


test/packettest.c:225:17: Call
223.       PACKET pkt;
224.   
225.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
                       ^
226.               || !PACKET_copy_bytes(&pkt, bytes, 4)
227.               ||  bytes[0] != 2 || bytes[1] != 4

ssl/packet_locl.h:109:8: Parameter `pkt->remaining`
  107.    * is being used.
  108.    */
  109.   __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
                ^
  110.                                                 const unsigned char *buf,
  111.                                                 size_t len)

test/packettest.c:226:17: Call
224.   
225.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
226.               || !PACKET_copy_bytes(&pkt, bytes, 4)
                       ^
227.               ||  bytes[0] != 2 || bytes[1] != 4
228.               ||  bytes[2] != 6 || bytes[3] != 8

ssl/packet_locl.h:373:8: Parameter `len`
  371.    * The caller is responsible for ensuring that |data| can hold |len| bytes.
  372.    */
  373.   __owur static ossl_inline int PACKET_copy_bytes(PACKET *pkt,
                ^
  374.                                                   unsigned char *data,
  375.                                                   size_t len)

ssl/packet_locl.h:380:5: Call
  378.           return 0;
  379.   
  380.       packet_forward(pkt, len);
             ^
  381.   
  382.       return 1;

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

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

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

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

ssl/packet_locl.h:84:5: Binary operation: ([0, +oo] - 4):unsigned64 by call to `PACKET_copy_bytes` 
    82.   {
    83.       pkt->curr += len;
    84.       pkt->remaining -= len;
              ^
    85.   }
    86.   

static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
    pkt->curr += len;
    pkt->remaining -= len;
}
['static int test_PACKET_copy_bytes(unsigned char buf[BUF_LEN])\n{\n    unsigned char bytes[4];\n    PACKET pkt;\n    if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)\n            || !PACKET_copy_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_copy_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_copy_bytes() failed\\n");\n        return 0;\n    }\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}']