crypto/bn/bn_exp.c:225: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul_reciprocal`.
Showing all 38 steps of the trace


crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth`
159.   }
160.   
161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
162.                       const BIGNUM *m, BN_CTX *ctx)
163.   {

crypto/bn/bn_exp.c:191:5: Call
189.       }
190.   
191.       BN_CTX_start(ctx);
           ^
192.       aa = BN_CTX_get(ctx);
193.       val[0] = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
  169.   }
  170.   
  171. > void BN_CTX_start(BN_CTX *ctx)
  172.   {
  173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_exp.c:192:10: Call
190.   
191.       BN_CTX_start(ctx);
192.       aa = BN_CTX_get(ctx);
                ^
193.       val[0] = BN_CTX_get(ctx);
194.       if (val[0] == NULL)

crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
  200.   }
  201.   
  202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  203.   {
  204.       BIGNUM *ret;

crypto/bn/bn_exp.c:193:14: Call
191.       BN_CTX_start(ctx);
192.       aa = BN_CTX_get(ctx);
193.       val[0] = BN_CTX_get(ctx);
                    ^
194.       if (val[0] == NULL)
195.           goto err;

crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
  200.   }
  201.   
  202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  203.   {
  204.       BIGNUM *ret;

crypto/bn/bn_exp.c:210:10: Call
208.       }
209.   
210.       if (!BN_nnmod(val[0], a, m, ctx))
                ^
211.           goto err;               /* 1 */
212.       if (BN_is_zero(val[0])) {

crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
  11.   #include "bn_lcl.h"
  12.   
  13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
  14.   {
  15.       /*

crypto/bn/bn_mod.c:20:11: Call
  18.        */
  19.   
  20.       if (!(BN_mod(r, m, d, ctx)))
                  ^
  21.           return 0;
  22.       if (!r->neg)

crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth`
    207.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
    208.    */
    209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
    210.              BN_CTX *ctx)
    211.   {

crypto/bn/bn_exp.c:220:14: Call
218.       window = BN_window_bits_for_exponent_size(bits);
219.       if (window > 1) {
220.           if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx))
                    ^
221.               goto err;           /* 2 */
222.           j = 1 << (window - 1);

crypto/bn/bn_recp.c:55:1: Parameter `ctx->stack.depth`
  53.   }
  54.   
  55. > int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
  56.                             BN_RECP_CTX *recp, BN_CTX *ctx)
  57.   {

crypto/bn/bn_recp.c:62:5: Call
  60.       const BIGNUM *ca;
  61.   
  62.       BN_CTX_start(ctx);
            ^
  63.       if ((a = BN_CTX_get(ctx)) == NULL)
  64.           goto err;

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
    169.   }
    170.   
    171. > void BN_CTX_start(BN_CTX *ctx)
    172.   {
    173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_recp.c:63:14: Call
  61.   
  62.       BN_CTX_start(ctx);
  63.       if ((a = BN_CTX_get(ctx)) == NULL)
                     ^
  64.           goto err;
  65.       if (y != NULL) {

crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
    200.   }
    201.   
    202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
    203.   {
    204.       BIGNUM *ret;

crypto/bn/bn_recp.c:79:5: Call
  77.       ret = BN_div_recp(NULL, r, ca, recp, ctx);
  78.    err:
  79.       BN_CTX_end(ctx);
            ^
  80.       bn_check_top(r);
  81.       return ret;

crypto/bn/bn_ctx.c:185:1: Parameter `ctx->stack.depth`
    183.   }
    184.   
    185. > void BN_CTX_end(BN_CTX *ctx)
    186.   {
    187.       CTXDBG("ENTER BN_CTX_end()", ctx);

crypto/bn/bn_exp.c:224:28: Call
222.           j = 1 << (window - 1);
223.           for (i = 1; i < j; i++) {
224.               if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
                                  ^
225.                   !BN_mod_mul_reciprocal(val[i], val[i - 1], aa, &recp, ctx))
226.                   goto err;

crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
  200.   }
  201.   
  202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  203.   {
  204.       BIGNUM *ret;

crypto/bn/bn_exp.c:225:18: Call
223.           for (i = 1; i < j; i++) {
224.               if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
225.                   !BN_mod_mul_reciprocal(val[i], val[i - 1], aa, &recp, ctx))
                        ^
226.                   goto err;
227.           }

crypto/bn/bn_recp.c:55:1: Parameter `ctx->stack.depth`
  53.   }
  54.   
  55. > int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
  56.                             BN_RECP_CTX *recp, BN_CTX *ctx)
  57.   {

crypto/bn/bn_recp.c:62:5: Call
  60.       const BIGNUM *ca;
  61.   
  62.       BN_CTX_start(ctx);
            ^
  63.       if ((a = BN_CTX_get(ctx)) == NULL)
  64.           goto err;

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
    169.   }
    170.   
    171. > void BN_CTX_start(BN_CTX *ctx)
    172.   {
    173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_recp.c:63:14: Call
  61.   
  62.       BN_CTX_start(ctx);
  63.       if ((a = BN_CTX_get(ctx)) == NULL)
                     ^
  64.           goto err;
  65.       if (y != NULL) {

crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
    200.   }
    201.   
    202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
    203.   {
    204.       BIGNUM *ret;

crypto/bn/bn_recp.c:77:11: Call
  75.           ca = x;                 /* Just do the mod */
  76.   
  77.       ret = BN_div_recp(NULL, r, ca, recp, ctx);
                  ^
  78.    err:
  79.       BN_CTX_end(ctx);

crypto/bn/bn_recp.c:90:5: Call
    88.       BIGNUM *a, *b, *d, *r;
    89.   
    90.       BN_CTX_start(ctx);
              ^
    91.       d = (dv != NULL) ? dv : BN_CTX_get(ctx);
    92.       r = (rem != NULL) ? rem : BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
      169.   }
      170.   
      171. > void BN_CTX_start(BN_CTX *ctx)
      172.   {
      173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_recp.c:101:13: Call
    99.           BN_zero(d);
    100.           if (!BN_copy(r, m)) {
    101.               BN_CTX_end(ctx);
                       ^
    102.               return 0;
    103.           }

crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
      183.   }
      184.   
      185. > void BN_CTX_end(BN_CTX *ctx)
      186.   {
      187.       CTXDBG("ENTER BN_CTX_end()", ctx);

crypto/bn/bn_ctx.c:191:27: Call
      189.           ctx->err_stack--;
      190.       else {
      191.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                       ^
      192.           /* Does this stack frame have anything to release? */
      193.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:266:1: <Offset trace>
264.   }
265.   
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267.   {
268.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
        264.   }
        265.   
        266. > static unsigned int BN_STACK_pop(BN_STACK *st)
        267.   {
        268.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:266:1: <Length trace>
264.   }
265.   
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267.   {
268.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes`
        264.   }
        265.   
        266. > static unsigned int BN_STACK_pop(BN_STACK *st)
        267.   {
        268.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul_reciprocal` 
        266.   static unsigned int BN_STACK_pop(BN_STACK *st)
        267.   {
        268.       return st->indexes[--(st->depth)];
                          ^
        269.   }
        270.   
