crypto/sm2/sm2_sign.c:257: error: BUFFER_OVERRUN_L3
  Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_mul`.
Showing all 29 steps of the trace


crypto/sm2/sm2_sign.c:238:21: Call
236.                   || !EC_POINT_get_affine_coordinates(group, kG, x1, NULL,
237.                                                       ctx)
238.                   || !BN_mod_add(r, e, x1, order, ctx)) {
                           ^
239.               SM2err(SM2_F_SM2_SIG_GEN, ERR_R_INTERNAL_ERROR);
240.               goto done;

crypto/bn/bn_mod.c:31:10: Call
  29.                  BN_CTX *ctx)
  30.   {
  31.       if (!BN_add(r, a, b))
                 ^
  32.           return 0;
  33.       return BN_nnmod(r, r, m, ctx);

crypto/bn/bn_add.c:28:19: Call
    26.           if (cmp_res > 0) {
    27.               r_neg = a->neg;
    28.               ret = BN_usub(r, a, b);
                            ^
    29.           } else if (cmp_res < 0) {
    30.               r_neg = b->neg;

crypto/bn/bn_add.c:125:1: Parameter `r->top`
      123.   
      124.   /* unsigned subtraction of b from a, a must be larger than b. */
      125. > int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
      126.   {
      127.       int max, min, dif;

crypto/sm2/sm2_sign.c:247:14: Call
245.               continue;
246.   
247.           if (!BN_add(rk, r, k)) {
                    ^
248.               SM2err(SM2_F_SM2_SIG_GEN, ERR_R_INTERNAL_ERROR);
249.               goto done;

crypto/bn/bn_add.c:14:1: Parameter `a->top`
  12.   
  13.   /* signed add of b to a. */
  14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
  15.   {
  16.       int ret, r_neg, cmp_res;

crypto/sm2/sm2_sign.c:252:13: Call
250.           }
251.   
252.           if (BN_cmp(rk, order) == 0)
                   ^
253.               continue;
254.   

crypto/bn/bn_lib.c:561:1: Parameter `a->top`
  559.   }
  560.   
  561. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
  562.   {
  563.       int i;

crypto/sm2/sm2_sign.c:255:14: Call
253.               continue;
254.   
255.           if (!BN_add(s, dA, BN_value_one())
                    ^
256.                   || !ec_group_do_inverse_ord(group, s, s, ctx)
257.                   || !BN_mod_mul(tmp, dA, r, order, ctx)

crypto/bn/bn_add.c:14:1: Parameter `a->top`
  12.   
  13.   /* signed add of b to a. */
  14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
  15.   {
  16.       int ret, r_neg, cmp_res;

crypto/sm2/sm2_sign.c:256:21: Call
254.   
255.           if (!BN_add(s, dA, BN_value_one())
256.                   || !ec_group_do_inverse_ord(group, s, s, ctx)
                           ^
257.                   || !BN_mod_mul(tmp, dA, r, order, ctx)
258.                   || !BN_sub(tmp, k, tmp)

crypto/ec/ec_lib.c:1096:1: Parameter `group->order->top`
  1094.    * other functionality.
  1095.    */
  1096. > int ec_group_do_inverse_ord(const EC_GROUP *group, BIGNUM *res,
  1097.                               const BIGNUM *x, BN_CTX *ctx)
  1098.   {

crypto/sm2/sm2_sign.c:257:21: Call
255.           if (!BN_add(s, dA, BN_value_one())
256.                   || !ec_group_do_inverse_ord(group, s, s, ctx)
257.                   || !BN_mod_mul(tmp, dA, r, order, ctx)
                           ^
258.                   || !BN_sub(tmp, k, tmp)
259.                   || !BN_mod_mul(s, s, tmp, order, ctx)) {

crypto/bn/bn_mod.c:193:1: Parameter `a->top`
  191.   
  192.   /* slow but works */
  193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
  194.                  BN_CTX *ctx)
  195.   {

crypto/bn/bn_mod.c:207:14: Call
  205.           goto err;
  206.       if (a == b) {
  207.           if (!BN_sqr(t, a, ctx))
                      ^
  208.               goto err;
  209.       } else {

crypto/bn/bn_sqr.c:17:1: Parameter `*r->d`
    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 `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:84:17: Call
      82.                   if (bn_wexpand(tmp, max) == NULL)
      83.                       goto err;
      84.                   bn_sqr_normal(rr->d, a->d, al, tmp->d);
                            ^
      85.               }
      86.           }

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: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_mul` 
        122.       if (--j > 0) {
        123.           ap++;
        124.           rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
                       ^
        125.           rp += 2;
        126.       }
