crypto/bn/bn_mont.c:67: error: BUFFER_OVERRUN_S2
  Offset: [max(2, `a->top`), min(15, `a->top`)] (⇐ 1 + [-1+max(2, `a->top`), -1+min(15, `a->top`)]) Size: [0, 8388607] by call to `bn_sqr_fixed_top`.
Showing all 14 steps of the trace


crypto/bn/bn_mont.c:37:1: Parameter `b->top`
35.   }
36.   
37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
38.                             BN_MONT_CTX *mont, BN_CTX *ctx)
39.   {

crypto/bn/bn_mont.c:67:14: Call
65.       bn_check_top(tmp);
66.       if (a == b) {
67.           if (!bn_sqr_fixed_top(tmp, a, ctx))
                   ^
68.               goto err;
69.       } else {

crypto/bn/bn_sqr.c:27:1: Parameter `a->top`
  25.   }
  26.   
  27. > int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
  28.   {
  29.       int max, al;

crypto/bn/bn_sqr.c:35:5: Assignment
  33.       bn_check_top(a);
  34.   
  35.       al = a->top;
            ^
  36.       if (al <= 0) {
  37.           r->top = 0;

crypto/bn/bn_sqr.c:70:13: Call
  68.           if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) {
  69.               BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2];
  70.               bn_sqr_normal(rr->d, a->d, al, t);
                    ^
  71.           } else {
  72.               int j, k;

crypto/bn/bn_sqr.c:109:1: <Offset trace>
107.   
108.   /* tmp must have 2*n words */
109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
110.   {
111.       int i, j, max;

crypto/bn/bn_sqr.c:109:1: Parameter `n`
    107.   
    108.   /* tmp must have 2*n words */
    109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
    110.   {
    111.       int i, j, max;

crypto/bn/bn_sqr.c:120:5: Assignment
    118.       rp[0] = rp[max - 1] = 0;
    119.       rp++;
    120.       j = n;
               ^
    121.   
    122.       if (--j > 0) {

crypto/bn/bn_sqr.c:122:9: Assignment
    120.       j = n;
    121.   
    122.       if (--j > 0) {
                   ^
    123.           ap++;
    124.           rp[j] = bn_mul_words(rp, ap, j, ap[-1]);

crypto/bn/bn_sqr.c:109:1: <Length trace>
107.   
108.   /* tmp must have 2*n words */
109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
110.   {
111.       int i, j, max;

crypto/bn/bn_sqr.c:109:1: Parameter `*r`
    107.   
    108.   /* tmp must have 2*n words */
    109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
    110.   {
    111.       int i, j, max;

crypto/bn/bn_sqr.c:117:5: Assignment
    115.       max = n * 2;
    116.       ap = a;
    117.       rp = r;
               ^
    118.       rp[0] = rp[max - 1] = 0;
    119.       rp++;

crypto/bn/bn_sqr.c:119:5: Assignment
    117.       rp = r;
    118.       rp[0] = rp[max - 1] = 0;
    119.       rp++;
               ^
    120.       j = n;
    121.   

crypto/bn/bn_sqr.c:124:9: Array access: Offset: [max(2, a->top), min(15, a->top)] (⇐ 1 + [-1+max(2, a->top), -1+min(15, a->top)]) Size: [0, 8388607] by call to `bn_sqr_fixed_top` 
    122.       if (--j > 0) {
    123.           ap++;
    124.           rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
                   ^
    125.           rp += 2;
    126.       }
