crypto/bn/bn_sqrt.c:194: 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:63:1: Parameter `ctx->stack.depth`
61.   #include "bn_lcl.h"
62.   
63. > BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
64.   /*
65.    * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks

crypto/bn/bn_sqrt.c:109:5: Call
107.       }
108.   
109.       BN_CTX_start(ctx);
           ^
110.       A = BN_CTX_get(ctx);
111.       b = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
  234.   }
  235.   
  236. > void BN_CTX_start(BN_CTX *ctx)
  237.   {
  238.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_sqrt.c:125:10: Call
123.   
124.       /* A = a mod p */
125.       if (!BN_nnmod(A, a, p, ctx))
                ^
126.           goto end;
127.   

crypto/bn/bn_mod.c:119:1: Parameter `ctx->stack.depth`
  117.   #include "bn_lcl.h"
  118.   
  119. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
  120.   {
  121.       /*

crypto/bn/bn_mod.c:126:11: Call
  124.        */
  125.   
  126.       if (!(BN_mod(r, m, d, ctx)))
                   ^
  127.           return 0;
  128.       if (!r->neg)

crypto/bn/bn_div.c:189:1: Parameter `ctx->stack.depth`
    187.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
    188.    */
    189. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
    190.              BN_CTX *ctx)
    191.   {

crypto/bn/bn_sqrt.c:190:14: Call
188.               goto end;
189.           q->neg = 0;
190.           if (!BN_mod_exp(b, t, q, p, ctx))
                    ^
191.               goto end;
192.   

crypto/bn/bn_exp.c:191:1: Parameter `ctx->stack.depth`
  189.   }
  190.   
  191. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  192.                  BN_CTX *ctx)
  193.   {

crypto/bn/bn_exp.c:248:19: Call
  246.               && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)) {
  247.               BN_ULONG A = a->d[0];
  248.               ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
                           ^
  249.           } else
  250.   # endif

crypto/bn/bn_exp.c:1152:1: Parameter `ctx->stack.depth`
    1150.   }
    1151.   
    1152. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
    1153.                            const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    1154.   {

crypto/bn/bn_sqrt.c:194:14: Call
192.   
193.           /* y := b^2 */
194.           if (!BN_mod_sqr(y, b, p, ctx))
                    ^
195.               goto end;
196.   

crypto/bn/bn_mod.c:208:1: Parameter `ctx->stack.depth`
  206.   }
  207.   
  208. > int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
  209.   {
  210.       if (!BN_sqr(r, a, ctx))

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

crypto/bn/bn_sqr.c:81:5: Call
    79.       }
    80.   
    81.       BN_CTX_start(ctx);
              ^
    82.       rr = (a != r) ? r : BN_CTX_get(ctx);
    83.       tmp = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:236:1: Parameter `*ctx->stack.indexes`
      234.   }
      235.   
      236. > void BN_CTX_start(BN_CTX *ctx)
      237.   {
      238.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_sqr.c:148:5: Call
    146.       bn_check_top(rr);
    147.       bn_check_top(tmp);
    148.       BN_CTX_end(ctx);
               ^
    149.       return (ret);
    150.   }

crypto/bn/bn_ctx.c:250:1: Parameter `*ctx->stack.indexes`
      248.   }
      249.   
      250. > void BN_CTX_end(BN_CTX *ctx)
      251.   {
      252.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:256:27: Call
      254.           ctx->err_stack--;
      255.       else {
      256.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                       ^
      257.           /* Does this stack frame have anything to release? */
      258.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:326:1: <Offset trace>
324.   }
325.   
326. > static unsigned int BN_STACK_pop(BN_STACK *st)
327.   {
328.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:326:1: Parameter `st->depth`
        324.   }
        325.   
        326. > static unsigned int BN_STACK_pop(BN_STACK *st)
        327.   {
        328.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:326:1: <Length trace>
324.   }
325.   
326. > static unsigned int BN_STACK_pop(BN_STACK *st)
327.   {
328.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:326:1: Parameter `*st->indexes`
        324.   }
        325.   
        326. > static unsigned int BN_STACK_pop(BN_STACK *st)
        327.   {
        328.       return st->indexes[--(st->depth)];

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