apps/s_server.c:241: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 67108856] by call to `SSL_set_srp_server_param`.
Showing all 12 steps of the trace


apps/s_server.c:241:9: Call
239.       }
240.   
241.       if (SSL_set_srp_server_param
               ^
242.           (s, p->user->N, p->user->g, p->user->s, p->user->v,
243.            p->user->info) < 0) {

ssl/tls_srp.c:236:1: Parameter `N->top`
  234.   }
  235.   
  236. > int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
  237.                                BIGNUM *sa, BIGNUM *v, char *info)
  238.   {

ssl/tls_srp.c:246:28: Call
  244.               }
  245.           } else
  246.               s->srp_ctx.N = BN_dup(N);
                                    ^
  247.       }
  248.       if (g != NULL) {

crypto/bn/bn_lib.c:304:1: Parameter `a->top`
    302.   }
    303.   
    304. > BIGNUM *BN_dup(const BIGNUM *a)
    305.   {
    306.       BIGNUM *t;

crypto/bn/bn_lib.c:315:10: Call
    313.       if (t == NULL)
    314.           return NULL;
    315.       if (!BN_copy(t, a)) {
                    ^
    316.           BN_free(t);
    317.           return NULL;

crypto/bn/bn_lib.c:323:1: <Offset trace>
321.   }
322.   
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324.   {
325.       bn_check_top(b);

crypto/bn/bn_lib.c:323:1: Parameter `b->top`
      321.   }
      322.   
      323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
      324.   {
      325.       bn_check_top(b);

crypto/bn/bn_lib.c:323:1: <Length trace>
321.   }
322.   
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324.   {
325.       bn_check_top(b);

crypto/bn/bn_lib.c:323:1: Parameter `*a->d`
      321.   }
      322.   
      323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
      324.   {
      325.       bn_check_top(b);

crypto/bn/bn_lib.c:329:9: Call
      327.       if (a == b)
      328.           return a;
      329.       if (bn_wexpand(a, b->top) == NULL)
                     ^
      330.           return NULL;
      331.   

crypto/bn/bn_lib.c:948:1: Parameter `*a->d`
        946.   }
        947.   
        948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
        949.   {
        950.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_lib.c:333:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `SSL_set_srp_server_param` 
      331.   
      332.       if (b->top > 0)
      333.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                     ^
      334.   
      335.       a->top = b->top;

BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
    bn_check_top(b);
    if (a == b)
        return a;
    if (bn_wexpand(a, b->top) == NULL)
        return NULL;
    if (b->top > 0)
        memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
    a->top = b->top;
    a->neg = b->neg;
    bn_check_top(a);
    return a;
}
['static int ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)\n{\n    srpsrvparm *p = (srpsrvparm *) arg;\n    int ret = SSL3_AL_FATAL;\n    if (p->login == NULL && p->user == NULL) {\n        p->login = SSL_get_srp_username(s);\n        BIO_printf(bio_err, "SRP username = \\"%s\\"\\n", p->login);\n        return (-1);\n    }\n    if (p->user == NULL) {\n        BIO_printf(bio_err, "User %s doesn\'t exist\\n", p->login);\n        goto err;\n    }\n    if (SSL_set_srp_server_param\n        (s, p->user->N, p->user->g, p->user->s, p->user->v,\n         p->user->info) < 0) {\n        *ad = SSL_AD_INTERNAL_ERROR;\n        goto err;\n    }\n    BIO_printf(bio_err,\n               "SRP parameters set: username = \\"%s\\" info=\\"%s\\" \\n",\n               p->login, p->user->info);\n    ret = SSL_ERROR_NONE;\n err:\n    SRP_user_pwd_free(p->user);\n    p->user = NULL;\n    p->login = NULL;\n    return ret;\n}', 'int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,\n                             BIGNUM *sa, BIGNUM *v, char *info)\n{\n    if (N != NULL) {\n        if (s->srp_ctx.N != NULL) {\n            if (!BN_copy(s->srp_ctx.N, N)) {\n                BN_free(s->srp_ctx.N);\n                s->srp_ctx.N = NULL;\n            }\n        } else\n            s->srp_ctx.N = BN_dup(N);\n    }\n    if (g != NULL) {\n        if (s->srp_ctx.g != NULL) {\n            if (!BN_copy(s->srp_ctx.g, g)) {\n                BN_free(s->srp_ctx.g);\n                s->srp_ctx.g = NULL;\n            }\n        } else\n            s->srp_ctx.g = BN_dup(g);\n    }\n    if (sa != NULL) {\n        if (s->srp_ctx.s != NULL) {\n            if (!BN_copy(s->srp_ctx.s, sa)) {\n                BN_free(s->srp_ctx.s);\n                s->srp_ctx.s = NULL;\n            }\n        } else\n            s->srp_ctx.s = BN_dup(sa);\n    }\n    if (v != NULL) {\n        if (s->srp_ctx.v != NULL) {\n            if (!BN_copy(s->srp_ctx.v, v)) {\n                BN_free(s->srp_ctx.v);\n                s->srp_ctx.v = NULL;\n            }\n        } else\n            s->srp_ctx.v = BN_dup(v);\n    }\n    s->srp_ctx.info = info;\n    if (!(s->srp_ctx.N) ||\n        !(s->srp_ctx.g) || !(s->srp_ctx.s) || !(s->srp_ctx.v))\n        return -1;\n    return 1;\n}', 'BIGNUM *BN_dup(const BIGNUM *a)\n{\n    BIGNUM *t;\n    if (a == NULL)\n        return NULL;\n    bn_check_top(a);\n    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();\n    if (t == NULL)\n        return NULL;\n    if (!BN_copy(t, a)) {\n        BN_free(t);\n        return NULL;\n    }\n    bn_check_top(t);\n    return t;\n}', 'BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)\n{\n    bn_check_top(b);\n    if (a == b)\n        return a;\n    if (bn_wexpand(a, b->top) == NULL)\n        return NULL;\n    if (b->top > 0)\n        memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);\n    a->top = b->top;\n    a->neg = b->neg;\n    bn_check_top(a);\n    return a;\n}', 'BIGNUM *bn_wexpand(BIGNUM *a, int words)\n{\n    return (words <= a->dmax) ? a : bn_expand2(a, words);\n}']