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


crypto/bio/b_dump.c:55:13: <RHS trace>
53.           rows++;
54.       for (i = 0; i < rows; i++) {
55.           n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
                  ^
56.                            i * dump_width);
57.           for (j = 0; j < dump_width; j++) {

crypto/bio/b_dump.c:55:13: Call
53.           rows++;
54.       for (i = 0; i < rows; i++) {
55.           n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
                  ^
56.                            i * dump_width);
57.           for (j = 0; j < dump_width; j++) {

crypto/bio/b_print.c:905:11: Call
  903.       va_start(args, format);
  904.   
  905.       ret = BIO_vsnprintf(buf, n, format, args);
                   ^
  906.   
  907.       va_end(args);

crypto/bio/b_print.c:917:9: Assignment
    915.   
    916.       if(!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
    917.           return -1;
                   ^
    918.   
    919.       if (truncated)

crypto/bio/b_print.c:905:5: Assignment
  903.       va_start(args, format);
  904.   
  905.       ret = BIO_vsnprintf(buf, n, format, args);
             ^
  906.   
  907.       va_end(args);

crypto/bio/b_print.c:908:5: Assignment
  906.   
  907.       va_end(args);
  908.       return ret;
             ^
  909.   }
  910.   

crypto/bio/b_dump.c:55:9: Assignment
53.           rows++;
54.       for (i = 0; i < rows; i++) {
55.           n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
              ^
56.                            i * dump_width);
57.           for (j = 0; j < dump_width; j++) {

crypto/bio/b_dump.c:76:17: Binary operation: (289 - [1, 2147483647]):unsigned64
74.               if (((i * dump_width) + j) >= len)
75.                   break;
76.               if (SPACE(buf, n, 1)) {
                      ^
77.                   ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
78.   #ifndef CHARSET_EBCDIC

int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
                       void *u, const char *s, int len, int indent)
{
    int ret = 0;
    char buf[288 + 1];
    int i, j, rows, trc, n;
    unsigned char ch;
    int dump_width;
    trc = 0;
#ifdef TRUNCATE
    for (; (len > 0) && ((s[len - 1] == ' ') || (s[len - 1] == '\0')); len--)
        trc++;
#endif
    if (indent < 0)
        indent = 0;
    else if (indent > 128)
        indent = 128;
    dump_width = DUMP_WIDTH_LESS_INDENT(indent);
    rows = len / dump_width;
    if ((rows * dump_width) < len)
        rows++;
    for (i = 0; i < rows; i++) {
        n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",
                         i * dump_width);
        for (j = 0; j < dump_width; j++) {
            if (SPACE(buf, n, 3)) {
                if (((i * dump_width) + j) >= len) {
                    strcpy(buf + n, "   ");
                } else {
                    ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
                    BIO_snprintf(buf + n, 4, "%02x%c", ch,
                                 j == 7 ? '-' : ' ');
                }
                n += 3;
            }
        }
        if (SPACE(buf, n, 2)) {
            strcpy(buf + n, "  ");
            n += 2;
        }
        for (j = 0; j < dump_width; j++) {
            if (((i * dump_width) + j) >= len)
                break;
            if (SPACE(buf, n, 1)) {
                ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
#ifndef CHARSET_EBCDIC
                buf[n++] = ((ch >= ' ') && (ch <= '~')) ? ch : '.';
#else
                buf[n++] = ((ch >= os_toascii[' ']) && (ch <= os_toascii['~']))
                           ? os_toebcdic[ch]
                           : '.';
#endif
                buf[n] = '\0';
            }
        }
        if (SPACE(buf, n, 1)) {
            buf[n++] = '\n';
            buf[n] = '\0';
        }
        ret += cb((void *)buf, n, u);
    }
#ifdef TRUNCATE
    if (trc > 0) {
        n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - <SPACES/NULS>\n",
                         indent, "", len + trc);
        ret += cb((void *)buf, n, u);
    }
#endif
    return ret;
}
['int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),\n                       void *u, const char *s, int len, int indent)\n{\n    int ret = 0;\n    char buf[288 + 1];\n    int i, j, rows, trc, n;\n    unsigned char ch;\n    int dump_width;\n    trc = 0;\n#ifdef TRUNCATE\n    for (; (len > 0) && ((s[len - 1] == \' \') || (s[len - 1] == \'\\0\')); len--)\n        trc++;\n#endif\n    if (indent < 0)\n        indent = 0;\n    else if (indent > 128)\n        indent = 128;\n    dump_width = DUMP_WIDTH_LESS_INDENT(indent);\n    rows = len / dump_width;\n    if ((rows * dump_width) < len)\n        rows++;\n    for (i = 0; i < rows; i++) {\n        n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "",\n                         i * dump_width);\n        for (j = 0; j < dump_width; j++) {\n            if (SPACE(buf, n, 3)) {\n                if (((i * dump_width) + j) >= len) {\n                    strcpy(buf + n, "   ");\n                } else {\n                    ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;\n                    BIO_snprintf(buf + n, 4, "%02x%c", ch,\n                                 j == 7 ? \'-\' : \' \');\n                }\n                n += 3;\n            }\n        }\n        if (SPACE(buf, n, 2)) {\n            strcpy(buf + n, "  ");\n            n += 2;\n        }\n        for (j = 0; j < dump_width; j++) {\n            if (((i * dump_width) + j) >= len)\n                break;\n            if (SPACE(buf, n, 1)) {\n                ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;\n#ifndef CHARSET_EBCDIC\n                buf[n++] = ((ch >= \' \') && (ch <= \'~\')) ? ch : \'.\';\n#else\n                buf[n++] = ((ch >= os_toascii[\' \']) && (ch <= os_toascii[\'~\']))\n                           ? os_toebcdic[ch]\n                           : \'.\';\n#endif\n                buf[n] = \'\\0\';\n            }\n        }\n        if (SPACE(buf, n, 1)) {\n            buf[n++] = \'\\n\';\n            buf[n] = \'\\0\';\n        }\n        ret += cb((void *)buf, n, u);\n    }\n#ifdef TRUNCATE\n    if (trc > 0) {\n        n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - <SPACES/NULS>\\n",\n                         indent, "", len + trc);\n        ret += cb((void *)buf, n, u);\n    }\n#endif\n    return ret;\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}']