crypto/bn/bn_sqrt.c:145: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_sqr`.
Showing all 30 steps of the trace


crypto/bn/bn_sqrt.c:13:1: Parameter `ctx->stack.depth`
11.   #include "bn_lcl.h"
12.   
13. > BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
14.   /*
15.    * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks

crypto/bn/bn_sqrt.c:59:5: Call
57.       }
58.   
59.       BN_CTX_start(ctx);
          ^
60.       A = BN_CTX_get(ctx);
61.       b = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:188:1: Parameter `ctx->stack.depth`
  186.   }
  187.   
  188. > void BN_CTX_start(BN_CTX *ctx)
  189.   {
  190.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_sqrt.c:75:10: Call
73.   
74.       /* A = a mod p */
75.       if (!BN_nnmod(A, a, p, ctx))
               ^
76.           goto end;
77.   

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_sqrt.c:141:14: Call
139.               goto end;
140.           q->neg = 0;
141.           if (!BN_mod_exp(b, t, q, p, ctx))
                    ^
142.               goto end;
143.   

crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth`
  87.   }
  88.   
  89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  90.                  BN_CTX *ctx)
  91.   {

crypto/bn/bn_exp.c:141:19: Call
  139.               && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) {
  140.               BN_ULONG A = a->d[0];
  141.               ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
                           ^
  142.           } else
  143.   # endif

crypto/bn/bn_exp.c:1129:1: Parameter `ctx->stack.depth`
    1127.   }
    1128.   
    1129. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
    1130.                            const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    1131.   {

crypto/bn/bn_sqrt.c:145:14: Call
143.   
144.           /* y := b^2 */
145.           if (!BN_mod_sqr(y, b, p, ctx))
                    ^
146.               goto end;
147.   

crypto/bn/bn_mod.c:222:1: Parameter `ctx->stack.depth`
  220.   }
  221.   
  222. > int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
  223.   {
  224.       if (!BN_sqr(r, a, ctx))

crypto/bn/bn_mod.c:224:10: Call
  222.   int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
  223.   {
  224.       if (!BN_sqr(r, a, ctx))
                  ^
  225.           return 0;
  226.       /* r->neg == 0,  thus we don't need BN_nnmod */

crypto/bn/bn_sqr.c:17:1: Parameter `ctx->stack.depth`
    15.    * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
    16.    */
    17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
    18.   {
    19.       int ret = bn_sqr_fixed_top(r, a, ctx);

crypto/bn/bn_sqr.c:19:15: Call
    17.   int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
    18.   {
    19.       int ret = bn_sqr_fixed_top(r, a, ctx);
                        ^
    20.   
    21.       bn_correct_top(r);

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

crypto/bn/bn_mod.c:227:12: Call
  225.           return 0;
  226.       /* r->neg == 0,  thus we don't need BN_nnmod */
  227.       return BN_mod(r, r, m, ctx);
                    ^
  228.   }
  229.   

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_div.c:229:11: Call
    227.       }
    228.   
    229.       ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
                     ^
    230.   
    231.       if (ret) {

crypto/bn/bn_div.c:280:5: Call
      278.       bn_check_top(rm);
      279.   
      280.       BN_CTX_start(ctx);
                 ^
      281.       res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
      282.       tmp = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:188:1: Parameter `*ctx->stack.indexes`
        186.   }
        187.   
        188. > void BN_CTX_start(BN_CTX *ctx)
        189.   {
        190.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_div.c:450:5: Call
      448.       if (rm != NULL)
      449.           bn_rshift_fixed_top(rm, snum, norm_shift);
      450.       BN_CTX_end(ctx);
                 ^
      451.       return 1;
      452.    err:

crypto/bn/bn_ctx.c:202:1: Parameter `*ctx->stack.indexes`
        200.   }
        201.   
        202. > void BN_CTX_end(BN_CTX *ctx)
        203.   {
        204.       if (ctx == NULL)

crypto/bn/bn_ctx.c:210:27: Call
        208.           ctx->err_stack--;
        209.       else {
        210.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                         ^
        211.           /* Does this stack frame have anything to release? */
        212.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:290:1: <Offset trace>
288.   }
289.   
290. > static unsigned int BN_STACK_pop(BN_STACK *st)
291.   {
292.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:290:1: Parameter `st->depth`
          288.   }
          289.   
          290. > static unsigned int BN_STACK_pop(BN_STACK *st)
          291.   {
          292.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:290:1: <Length trace>
288.   }
289.   
290. > static unsigned int BN_STACK_pop(BN_STACK *st)
291.   {
292.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:290:1: Parameter `*st->indexes`
          288.   }
          289.   
          290. > static unsigned int BN_STACK_pop(BN_STACK *st)
          291.   {
          292.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:292:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_sqr` 
          290.   static unsigned int BN_STACK_pop(BN_STACK *st)
          291.   {
          292.       return st->indexes[--(st->depth)];
                            ^
          293.   }
          294.   
