crypto/bn/bn_sqrt.c:144: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_sqr`.
Showing all 24 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:181:1: Parameter `ctx->stack.depth`
  179.   }
  180.   
  181. > void BN_CTX_start(BN_CTX *ctx)
  182.   {
  183.       CTXDBG_ENTRY("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:137:1: Parameter `ctx->stack.depth`
    135.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
    136.    */
    137. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
    138.              BN_CTX *ctx)
    139.   {

crypto/bn/bn_sqrt.c:140:14: Call
138.               goto end;
139.           q->neg = 0;
140.           if (!BN_mod_exp(b, t, q, p, ctx))
                    ^
141.               goto end;
142.   

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:1095:1: Parameter `ctx->stack.depth`
    1093.   }
    1094.   
    1095. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
    1096.                            const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    1097.   {

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

crypto/bn/bn_mod.c:102:1: Parameter `ctx->stack.depth`
  100.   }
  101.   
  102. > int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
  103.   {
  104.       if (!BN_sqr(r, a, ctx))

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

crypto/bn/bn_sqr.c:32:5: Call
    30.       }
    31.   
    32.       BN_CTX_start(ctx);
              ^
    33.       rr = (a != r) ? r : BN_CTX_get(ctx);
    34.       tmp = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes`
      179.   }
      180.   
      181. > void BN_CTX_start(BN_CTX *ctx)
      182.   {
      183.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_sqr.c:100:5: Call
    98.       bn_check_top(rr);
    99.       bn_check_top(tmp);
    100.       BN_CTX_end(ctx);
               ^
    101.       return ret;
    102.   }

crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes`
      193.   }
      194.   
      195. > void BN_CTX_end(BN_CTX *ctx)
      196.   {
      197.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:201:27: Call
      199.           ctx->err_stack--;
      200.       else {
      201.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                       ^
      202.           /* Does this stack frame have anything to release? */
      203.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:271:1: <Offset trace>
269.   }
270.   
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272.   {
273.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:271:1: Parameter `st->depth`
        269.   }
        270.   
        271. > static unsigned int BN_STACK_pop(BN_STACK *st)
        272.   {
        273.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:271:1: <Length trace>
269.   }
270.   
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272.   {
273.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes`
        269.   }
        270.   
        271. > static unsigned int BN_STACK_pop(BN_STACK *st)
        272.   {
        273.       return st->indexes[--(st->depth)];

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