crypto/bio/bio_cb.c:35: error: INTEGER_OVERFLOW_L2
  (256 - [0, 2147483647]):unsigned64.
Showing all 3 steps of the trace


crypto/bio/bio_cb.c:33:9: <RHS trace>
31.       /* Ignore errors and continue printing the other information. */
32.       if (len < 0)
33.           len = 0;
              ^
34.       p = buf + len;
35.       left = sizeof(buf) - len;

crypto/bio/bio_cb.c:33:9: Assignment
31.       /* Ignore errors and continue printing the other information. */
32.       if (len < 0)
33.           len = 0;
              ^
34.       p = buf + len;
35.       left = sizeof(buf) - len;

crypto/bio/bio_cb.c:35:5: Binary operation: (256 - [0, 2147483647]):unsigned64
33.           len = 0;
34.       p = buf + len;
35.       left = sizeof(buf) - len;
          ^
36.   
37.       switch (cmd) {

long BIO_debug_callback(BIO *bio, int cmd, const char *argp,
                        int argi, long argl, long ret)
{
    BIO *b;
    char buf[256];
    char *p;
    long r = 1;
    int len, left;
    if (BIO_CB_RETURN & cmd)
        r = ret;
    len = BIO_snprintf(buf, sizeof(buf), "BIO[%p]: ", (void *)bio);
    if (len < 0)
        len = 0;
    p = buf + len;
    left = sizeof(buf) - len;
    switch (cmd) {
    case BIO_CB_FREE:
        BIO_snprintf(p, left, "Free - %s\n", bio->method->name);
        break;
    case BIO_CB_READ:
        if (bio->method->type & BIO_TYPE_DESCRIPTOR)
            BIO_snprintf(p, left, "read(%d,%lu) - %s fd=%d\n",
                         bio->num, (unsigned long)argi,
                         bio->method->name, bio->num);
        else
            BIO_snprintf(p, left, "read(%d,%lu) - %s\n",
                    bio->num, (unsigned long)argi, bio->method->name);
        break;
    case BIO_CB_WRITE:
        if (bio->method->type & BIO_TYPE_DESCRIPTOR)
            BIO_snprintf(p, left, "write(%d,%lu) - %s fd=%d\n",
                         bio->num, (unsigned long)argi,
                         bio->method->name, bio->num);
        else
            BIO_snprintf(p, left, "write(%d,%lu) - %s\n",
                         bio->num, (unsigned long)argi, bio->method->name);
        break;
    case BIO_CB_PUTS:
        BIO_snprintf(p, left, "puts() - %s\n", bio->method->name);
        break;
    case BIO_CB_GETS:
        BIO_snprintf(p, left, "gets(%lu) - %s\n", (unsigned long)argi,
                     bio->method->name);
        break;
    case BIO_CB_CTRL:
        BIO_snprintf(p, left, "ctrl(%lu) - %s\n", (unsigned long)argi,
                     bio->method->name);
        break;
    case BIO_CB_RETURN | BIO_CB_READ:
        BIO_snprintf(p, left, "read return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_WRITE:
        BIO_snprintf(p, left, "write return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_GETS:
        BIO_snprintf(p, left, "gets return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_PUTS:
        BIO_snprintf(p, left, "puts return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_CTRL:
        BIO_snprintf(p, left, "ctrl return %ld\n", ret);
        break;
    default:
        BIO_snprintf(p, left, "bio callback - unknown type (%d)\n", cmd);
        break;
    }
    b = (BIO *)bio->cb_arg;
    if (b != NULL)
        BIO_write(b, buf, strlen(buf));
#if !defined(OPENSSL_NO_STDIO)
    else
        fputs(buf, stderr);
#endif
    return r;
}
['long BIO_debug_callback(BIO *bio, int cmd, const char *argp,\n                        int argi, long argl, long ret)\n{\n    BIO *b;\n    char buf[256];\n    char *p;\n    long r = 1;\n    int len, left;\n    if (BIO_CB_RETURN & cmd)\n        r = ret;\n    len = BIO_snprintf(buf, sizeof(buf), "BIO[%p]: ", (void *)bio);\n    if (len < 0)\n        len = 0;\n    p = buf + len;\n    left = sizeof(buf) - len;\n    switch (cmd) {\n    case BIO_CB_FREE:\n        BIO_snprintf(p, left, "Free - %s\\n", bio->method->name);\n        break;\n    case BIO_CB_READ:\n        if (bio->method->type & BIO_TYPE_DESCRIPTOR)\n            BIO_snprintf(p, left, "read(%d,%lu) - %s fd=%d\\n",\n                         bio->num, (unsigned long)argi,\n                         bio->method->name, bio->num);\n        else\n            BIO_snprintf(p, left, "read(%d,%lu) - %s\\n",\n                    bio->num, (unsigned long)argi, bio->method->name);\n        break;\n    case BIO_CB_WRITE:\n        if (bio->method->type & BIO_TYPE_DESCRIPTOR)\n            BIO_snprintf(p, left, "write(%d,%lu) - %s fd=%d\\n",\n                         bio->num, (unsigned long)argi,\n                         bio->method->name, bio->num);\n        else\n            BIO_snprintf(p, left, "write(%d,%lu) - %s\\n",\n                         bio->num, (unsigned long)argi, bio->method->name);\n        break;\n    case BIO_CB_PUTS:\n        BIO_snprintf(p, left, "puts() - %s\\n", bio->method->name);\n        break;\n    case BIO_CB_GETS:\n        BIO_snprintf(p, left, "gets(%lu) - %s\\n", (unsigned long)argi,\n                     bio->method->name);\n        break;\n    case BIO_CB_CTRL:\n        BIO_snprintf(p, left, "ctrl(%lu) - %s\\n", (unsigned long)argi,\n                     bio->method->name);\n        break;\n    case BIO_CB_RETURN | BIO_CB_READ:\n        BIO_snprintf(p, left, "read return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_WRITE:\n        BIO_snprintf(p, left, "write return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_GETS:\n        BIO_snprintf(p, left, "gets return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_PUTS:\n        BIO_snprintf(p, left, "puts return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_CTRL:\n        BIO_snprintf(p, left, "ctrl return %ld\\n", ret);\n        break;\n    default:\n        BIO_snprintf(p, left, "bio callback - unknown type (%d)\\n", cmd);\n        break;\n    }\n    b = (BIO *)bio->cb_arg;\n    if (b != NULL)\n        BIO_write(b, buf, strlen(buf));\n#if !defined(OPENSSL_NO_STDIO)\n    else\n        fputs(buf, stderr);\n#endif\n    return r;\n}']