crypto/bio/b_print.c:627: error: BUFFER_OVERRUN_L3
  Offset: [-9, 9] Size: 17.
Showing all 11 steps of the trace


crypto/bio/b_print.c:576:1: <Offset trace>
574.   }
575.   
576. > static void
577.   fmtfp(
578.       char *buffer,

crypto/bio/b_print.c:576:1: Parameter `fvalue`
574.   }
575.   
576. > static void
577.   fmtfp(
578.       char *buffer,

crypto/bio/b_print.c:600:15: Call
598.       if (max < 0)
599.           max = 6;
600.       ufvalue = abs_val(fvalue);
                     ^
601.       if (fvalue < 0)
602.           signvalue = '-';

crypto/bio/b_print.c:545:1: Parameter `value`
  543.   }
  544.   
  545. > static LDOUBLE
  546.   abs_val(LDOUBLE value)
  547.   {

crypto/bio/b_print.c:548:5: Assignment
  546.   abs_val(LDOUBLE value)
  547.   {
  548.       LDOUBLE result = value;
             ^
  549.       if (value < 0)
  550.           result = -value;

crypto/bio/b_print.c:551:5: Assignment
  549.       if (value < 0)
  550.           result = -value;
  551.       return result;
             ^
  552.   }
  553.   

crypto/bio/b_print.c:600:5: Assignment
598.       if (max < 0)
599.           max = 6;
600.       ufvalue = abs_val(fvalue);
           ^
601.       if (fvalue < 0)
602.           signvalue = '-';

crypto/bio/b_print.c:608:5: Assignment
606.           signvalue = ' ';
607.   
608.       intpart = (long)ufvalue;
           ^
609.   
610.       /* sorry, we only support 9 digits past the decimal because of our

crypto/bio/b_print.c:627:14: <Length trace>
625.       do {
626.           iconvert[iplace++] =
627.               (caps ? "0123456789ABCDEF"
                    ^
628.                 : "0123456789abcdef")[intpart % 10];
629.           intpart = (intpart / 10);

crypto/bio/b_print.c:627:14: Array declaration
625.       do {
626.           iconvert[iplace++] =
627.               (caps ? "0123456789ABCDEF"
                    ^
628.                 : "0123456789abcdef")[intpart % 10];
629.           intpart = (intpart / 10);

crypto/bio/b_print.c:627:13: Array access: Offset: [-9, 9] Size: 17
625.       do {
626.           iconvert[iplace++] =
627.               (caps ? "0123456789ABCDEF"
                   ^
628.                 : "0123456789abcdef")[intpart % 10];
629.           intpart = (intpart / 10);

static void
fmtfp(
    char *buffer,
    size_t *currlen,
    size_t maxlen,
    LDOUBLE fvalue,
    int min,
    int max,
    int flags)
{
    int signvalue = 0;
    LDOUBLE ufvalue;
    char iconvert[20];
    char fconvert[20];
    int iplace = 0;
    int fplace = 0;
    int padlen = 0;
    int zpadlen = 0;
    int caps = 0;
    long intpart;
    long fracpart;
    if (max < 0)
        max = 6;
    ufvalue = abs_val(fvalue);
    if (fvalue < 0)
        signvalue = '-';
    else if (flags & DP_F_PLUS)
        signvalue = '+';
    else if (flags & DP_F_SPACE)
        signvalue = ' ';
    intpart = (long)ufvalue;
    if (max > 9)
        max = 9;
    fracpart = round((pow10(max)) * (ufvalue - intpart));
    if (fracpart >= pow10(max)) {
        intpart++;
        fracpart -= (long)pow10(max);
    }
    do {
        iconvert[iplace++] =
            (caps ? "0123456789ABCDEF"
              : "0123456789abcdef")[intpart % 10];
        intpart = (intpart / 10);
    } while (intpart && (iplace < 20));
    if (iplace == 20)
        iplace--;
    iconvert[iplace] = 0;
    do {
        fconvert[fplace++] =
            (caps ? "0123456789ABCDEF"
              : "0123456789abcdef")[fracpart % 10];
        fracpart = (fracpart / 10);
    } while (fracpart && (fplace < 20));
    if (fplace == 20)
        fplace--;
    fconvert[fplace] = 0;
    padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
    zpadlen = max - fplace;
    if (zpadlen < 0)
        zpadlen = 0;
    if (padlen < 0)
        padlen = 0;
    if (flags & DP_F_MINUS)
        padlen = -padlen;
    if ((flags & DP_F_ZERO) && (padlen > 0)) {
        if (signvalue) {
            dopr_outch(buffer, currlen, maxlen, signvalue);
            --padlen;
            signvalue = 0;
        }
        while (padlen > 0) {
            dopr_outch(buffer, currlen, maxlen, '0');
            --padlen;
        }
    }
    while (padlen > 0) {
        dopr_outch(buffer, currlen, maxlen, ' ');
        --padlen;
    }
    if (signvalue)
        dopr_outch(buffer, currlen, maxlen, signvalue);
    while (iplace > 0)
        dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]);
    if (max > 0) {
        dopr_outch(buffer, currlen, maxlen, '.');
        while (fplace > 0)
            dopr_outch(buffer, currlen, maxlen, fconvert[--fplace]);
    }
    while (zpadlen > 0) {
        dopr_outch(buffer, currlen, maxlen, '0');
        --zpadlen;
    }
    while (padlen < 0) {
        dopr_outch(buffer, currlen, maxlen, ' ');
        ++padlen;
    }
}
['static void\nfmtfp(\n    char *buffer,\n    size_t *currlen,\n    size_t maxlen,\n    LDOUBLE fvalue,\n    int min,\n    int max,\n    int flags)\n{\n    int signvalue = 0;\n    LDOUBLE ufvalue;\n    char iconvert[20];\n    char fconvert[20];\n    int iplace = 0;\n    int fplace = 0;\n    int padlen = 0;\n    int zpadlen = 0;\n    int caps = 0;\n    long intpart;\n    long fracpart;\n    if (max < 0)\n        max = 6;\n    ufvalue = abs_val(fvalue);\n    if (fvalue < 0)\n        signvalue = \'-\';\n    else if (flags & DP_F_PLUS)\n        signvalue = \'+\';\n    else if (flags & DP_F_SPACE)\n        signvalue = \' \';\n    intpart = (long)ufvalue;\n    if (max > 9)\n        max = 9;\n    fracpart = round((pow10(max)) * (ufvalue - intpart));\n    if (fracpart >= pow10(max)) {\n        intpart++;\n        fracpart -= (long)pow10(max);\n    }\n    do {\n        iconvert[iplace++] =\n            (caps ? "0123456789ABCDEF"\n              : "0123456789abcdef")[intpart % 10];\n        intpart = (intpart / 10);\n    } while (intpart && (iplace < 20));\n    if (iplace == 20)\n        iplace--;\n    iconvert[iplace] = 0;\n    do {\n        fconvert[fplace++] =\n            (caps ? "0123456789ABCDEF"\n              : "0123456789abcdef")[fracpart % 10];\n        fracpart = (fracpart / 10);\n    } while (fracpart && (fplace < 20));\n    if (fplace == 20)\n        fplace--;\n    fconvert[fplace] = 0;\n    padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);\n    zpadlen = max - fplace;\n    if (zpadlen < 0)\n        zpadlen = 0;\n    if (padlen < 0)\n        padlen = 0;\n    if (flags & DP_F_MINUS)\n        padlen = -padlen;\n    if ((flags & DP_F_ZERO) && (padlen > 0)) {\n        if (signvalue) {\n            dopr_outch(buffer, currlen, maxlen, signvalue);\n            --padlen;\n            signvalue = 0;\n        }\n        while (padlen > 0) {\n            dopr_outch(buffer, currlen, maxlen, \'0\');\n            --padlen;\n        }\n    }\n    while (padlen > 0) {\n        dopr_outch(buffer, currlen, maxlen, \' \');\n        --padlen;\n    }\n    if (signvalue)\n        dopr_outch(buffer, currlen, maxlen, signvalue);\n    while (iplace > 0)\n        dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]);\n    if (max > 0) {\n        dopr_outch(buffer, currlen, maxlen, \'.\');\n        while (fplace > 0)\n            dopr_outch(buffer, currlen, maxlen, fconvert[--fplace]);\n    }\n    while (zpadlen > 0) {\n        dopr_outch(buffer, currlen, maxlen, \'0\');\n        --zpadlen;\n    }\n    while (padlen < 0) {\n        dopr_outch(buffer, currlen, maxlen, \' \');\n        ++padlen;\n    }\n}', 'static LDOUBLE\nabs_val(LDOUBLE value)\n{\n    LDOUBLE result = value;\n    if (value < 0)\n        result = -value;\n    return result;\n}']