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


crypto/bio/bio_cb.c:78:11: <RHS trace>
76.           r = ret;
77.   
78.       len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
                ^
79.   
80.       p = buf + len;

crypto/bio/bio_cb.c:78:11: Call
76.           r = ret;
77.   
78.       len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
                ^
79.   
80.       p = buf + len;

crypto/bio/b_print.c:836:11: Call
  834.       va_start(args, format);
  835.   
  836.       ret = BIO_vsnprintf(buf, n, format, args);
                   ^
  837.   
  838.       va_end(args);

crypto/bio/b_print.c:848:9: Assignment
    846.   
    847.       if(!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
    848.           return -1;
                   ^
    849.   
    850.       if (truncated)

crypto/bio/b_print.c:836:5: Assignment
  834.       va_start(args, format);
  835.   
  836.       ret = BIO_vsnprintf(buf, n, format, args);
             ^
  837.   
  838.       va_end(args);

crypto/bio/b_print.c:839:5: Assignment
  837.   
  838.       va_end(args);
  839.       return (ret);
             ^
  840.   }
  841.   

crypto/bio/bio_cb.c:78:5: Assignment
76.           r = ret;
77.   
78.       len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
          ^
79.   
80.       p = buf + len;

crypto/bio/bio_cb.c:81:5: Binary operation: (256 - [-1, 2147483647]):unsigned64
79.   
80.       p = buf + len;
81.       p_maxlen = sizeof(buf) - len;
          ^
82.   
83.       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;
    size_t p_maxlen;
    if (BIO_CB_RETURN & cmd)
        r = ret;
    len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
    p = buf + len;
    p_maxlen = sizeof(buf) - len;
    switch (cmd) {
    case BIO_CB_FREE:
        BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
        break;
    case BIO_CB_READ:
        if (bio->method->type & BIO_TYPE_DESCRIPTOR)
            BIO_snprintf(p, p_maxlen, "read(%d,%lu) - %s fd=%d\n",
                         bio->num, (unsigned long)argi,
                         bio->method->name, bio->num);
        else
            BIO_snprintf(p, p_maxlen, "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, p_maxlen, "write(%d,%lu) - %s fd=%d\n",
                         bio->num, (unsigned long)argi,
                         bio->method->name, bio->num);
        else
            BIO_snprintf(p, p_maxlen, "write(%d,%lu) - %s\n",
                         bio->num, (unsigned long)argi, bio->method->name);
        break;
    case BIO_CB_PUTS:
        BIO_snprintf(p, p_maxlen, "puts() - %s\n", bio->method->name);
        break;
    case BIO_CB_GETS:
        BIO_snprintf(p, p_maxlen, "gets(%lu) - %s\n", (unsigned long)argi,
                     bio->method->name);
        break;
    case BIO_CB_CTRL:
        BIO_snprintf(p, p_maxlen, "ctrl(%lu) - %s\n", (unsigned long)argi,
                     bio->method->name);
        break;
    case BIO_CB_RETURN | BIO_CB_READ:
        BIO_snprintf(p, p_maxlen, "read return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_WRITE:
        BIO_snprintf(p, p_maxlen, "write return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_GETS:
        BIO_snprintf(p, p_maxlen, "gets return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_PUTS:
        BIO_snprintf(p, p_maxlen, "puts return %ld\n", ret);
        break;
    case BIO_CB_RETURN | BIO_CB_CTRL:
        BIO_snprintf(p, p_maxlen, "ctrl return %ld\n", ret);
        break;
    default:
        BIO_snprintf(p, p_maxlen, "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;\n    size_t p_maxlen;\n    if (BIO_CB_RETURN & cmd)\n        r = ret;\n    len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);\n    p = buf + len;\n    p_maxlen = sizeof(buf) - len;\n    switch (cmd) {\n    case BIO_CB_FREE:\n        BIO_snprintf(p, p_maxlen, "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, p_maxlen, "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, p_maxlen, "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, p_maxlen, "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, p_maxlen, "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, p_maxlen, "puts() - %s\\n", bio->method->name);\n        break;\n    case BIO_CB_GETS:\n        BIO_snprintf(p, p_maxlen, "gets(%lu) - %s\\n", (unsigned long)argi,\n                     bio->method->name);\n        break;\n    case BIO_CB_CTRL:\n        BIO_snprintf(p, p_maxlen, "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, p_maxlen, "read return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_WRITE:\n        BIO_snprintf(p, p_maxlen, "write return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_GETS:\n        BIO_snprintf(p, p_maxlen, "gets return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_PUTS:\n        BIO_snprintf(p, p_maxlen, "puts return %ld\\n", ret);\n        break;\n    case BIO_CB_RETURN | BIO_CB_CTRL:\n        BIO_snprintf(p, p_maxlen, "ctrl return %ld\\n", ret);\n        break;\n    default:\n        BIO_snprintf(p, p_maxlen, "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}', 'int BIO_snprintf(char *buf, size_t n, const char *format, ...)\n{\n    va_list args;\n    int ret;\n    va_start(args, format);\n    ret = BIO_vsnprintf(buf, n, format, args);\n    va_end(args);\n    return (ret);\n}', 'int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)\n{\n    size_t retlen;\n    int truncated;\n    if(!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))\n        return -1;\n    if (truncated)\n        return -1;\n    else\n        return (retlen <= INT_MAX) ? (int)retlen : -1;\n}']