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


test/packettest.c:194:17: Call
192.       PACKET pkt;
193.   
194.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
                       ^
195.               || !PACKET_copy_bytes(&pkt, bytes, 4)
196.               ||  bytes[0] != 2 || bytes[1] != 4

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/packettest.c:195:17: Call
193.   
194.       if (       !PACKET_buf_init(&pkt, buf, BUF_LEN)
195.               || !PACKET_copy_bytes(&pkt, bytes, 4)
                       ^
196.               ||  bytes[0] != 2 || bytes[1] != 4
197.               ||  bytes[2] != 6 || bytes[3] != 8

ssl/packet_locl.h:331:8: Parameter `len`
  329.    * The caller is responsible for ensuring that |data| can hold |len| bytes.
  330.    */
  331.   __owur static ossl_inline int PACKET_copy_bytes(PACKET *pkt,
                ^
  332.                                                   unsigned char *data, size_t len)
  333.   {

ssl/packet_locl.h:337:5: Call
  335.           return 0;
  336.   
  337.       packet_forward(pkt, len);
             ^
  338.   
  339.       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: ([0, +oo] - 4):unsigned64 by call to `PACKET_copy_bytes` 
    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 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}']