ssl/s3_both.c:154: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `ssl3_send_alert`.
Showing all 14 steps of the trace


ssl/s3_both.c:117:4: Call
115.   	 */ 
116.   
117.   	n=ssl3_get_message(s,
          ^
118.   		a,
119.   		b,

ssl/s3_both.c:264:1: Parameter `s->ctx->sessions->p`
  262.    * the body is read in state 'stn'.
  263.    */
  264. > long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
  265.   	{
  266.   	unsigned char *p;

ssl/s3_both.c:154:2: Call
152.   	return(1);
153.   f_err:
154.   	ssl3_send_alert(s,SSL3_AL_FATAL,al);
        ^
155.   	return(0);
156.   	}

ssl/s3_pkt.c:1037:1: Parameter `s->ctx->sessions->p`
  1035.   	}
  1036.   
  1037. > void ssl3_send_alert(SSL *s, int level, int desc)
  1038.   	{
  1039.   	/* Map tls/ssl alert value to correct one */

ssl/s3_pkt.c:1044:3: Call
  1042.   	/* If a fatal one, remove from cache */
  1043.   	if ((level == 2) && (s->session != NULL))
  1044.   		SSL_CTX_remove_session(s->ctx,s->session);
            ^
  1045.   
  1046.   	s->s3->alert_dispatch=1;

ssl/ssl_sess.c:413:1: Parameter `ctx->sessions->p`
    411.   	}
    412.   
    413. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
    414.   {
    415.   	return remove_session_lock(ctx, c, 1);

ssl/ssl_sess.c:415:9: Call
    413.   int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
    414.   {
    415.   	return remove_session_lock(ctx, c, 1);
                   ^
    416.   }
    417.   

ssl/ssl_sess.c:418:1: Parameter `ctx->sessions->p`
      416.   }
      417.   
      418. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
      419.   	{
      420.   	SSL_SESSION *r;

ssl/ssl_sess.c:426:20: Call
      424.   		{
      425.   		if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);
      426.   		r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
                                ^
      427.   		if (r != NULL)
      428.   			{

crypto/lhash/lhash.c:217:1: Parameter `lh->pmax`
        215.   	}
        216.   
        217. > void *lh_delete(LHASH *lh, void *data)
        218.   	{
        219.   	unsigned long hash;

crypto/lhash/lhash.c:243:3: Call
        241.   	if ((lh->num_nodes > MIN_NODES) &&
        242.   		(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
        243.   		contract(lh);
                 ^
        244.   
        245.   	return(ret);

crypto/lhash/lhash.c:352:1: <LHS trace>
350.   	}
351.   
352. > static void contract(LHASH *lh)
353.   	{
354.   	LHASH_NODE **n,*n1,*np;

crypto/lhash/lhash.c:352:1: Parameter `lh->p`
          350.   	}
          351.   
          352. > static void contract(LHASH *lh)
          353.   	{
          354.   	LHASH_NODE **n,*n1,*np;

crypto/lhash/lhash.c:356:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ssl3_send_alert` 
          354.   	LHASH_NODE **n,*n1,*np;
          355.   
          356.   	np=lh->b[lh->p+lh->pmax-1];
                     ^
          357.   	lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */
          358.   	if (lh->p == 0)

static void contract(LHASH *lh)
	{
	LHASH_NODE **n,*n1,*np;
	np=lh->b[lh->p+lh->pmax-1];
	lh->b[lh->p+lh->pmax-1]=NULL;
	if (lh->p == 0)
		{
		n=(LHASH_NODE **)Realloc(lh->b,
			(unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));
		if (n == NULL)
			{
			lh->error++;
			return;
			}
		lh->num_contract_reallocs++;
		lh->num_alloc_nodes/=2;
		lh->pmax/=2;
		lh->p=lh->pmax-1;
		lh->b=n;
		}
	else
		lh->p--;
	lh->num_nodes--;
	lh->num_contracts++;
	n1=lh->b[(int)lh->p];
	if (n1 == NULL)
		lh->b[(int)lh->p]=np;
	else
		{
		while (n1->next != NULL)
			n1=n1->next;
		n1->next=np;
		}
	}
['int ssl3_get_finished(SSL *s, int a, int b)\n\t{\n\tint al,i,ok;\n\tlong n;\n\tunsigned char *p;\n\tn=ssl3_get_message(s,\n\t\ta,\n\t\tb,\n\t\tSSL3_MT_FINISHED,\n\t\t64,\n\t\t&ok);\n\tif (!ok) return((int)n);\n\tif (!s->s3->change_cipher_spec)\n\t\t{\n\t\tal=SSL_AD_UNEXPECTED_MESSAGE;\n\t\tSSLerr(SSL_F_SSL3_GET_FINISHED,SSL_R_GOT_A_FIN_BEFORE_A_CCS);\n\t\tgoto f_err;\n\t\t}\n\ts->s3->change_cipher_spec=0;\n\tp = (unsigned char *)s->init_buf->data;\n\ti = s->s3->tmp.peer_finish_md_len;\n\tif (i != n)\n\t\t{\n\t\tal=SSL_AD_DECODE_ERROR;\n\t\tSSLerr(SSL_F_SSL3_GET_FINISHED,SSL_R_BAD_DIGEST_LENGTH);\n\t\tgoto f_err;\n\t\t}\n\tif (memcmp(p, s->s3->tmp.peer_finish_md, i) != 0)\n\t\t{\n\t\tal=SSL_AD_DECRYPT_ERROR;\n\t\tSSLerr(SSL_F_SSL3_GET_FINISHED,SSL_R_DIGEST_CHECK_FAILED);\n\t\tgoto f_err;\n\t\t}\n\treturn(1);\nf_err:\n\tssl3_send_alert(s,SSL3_AL_FATAL,al);\n\treturn(0);\n\t}', 'long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)\n\t{\n\tunsigned char *p;\n\tunsigned long l;\n\tlong n;\n\tint i,al;\n\tif (s->s3->tmp.reuse_message)\n\t\t{\n\t\ts->s3->tmp.reuse_message=0;\n\t\tif ((mt >= 0) && (s->s3->tmp.message_type != mt))\n\t\t\t{\n\t\t\tal=SSL_AD_UNEXPECTED_MESSAGE;\n\t\t\tSSLerr(SSL_F_SSL3_GET_MESSAGE,SSL_R_UNEXPECTED_MESSAGE);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\t*ok=1;\n\t\treturn((int)s->s3->tmp.message_size);\n\t\t}\n\tp=(unsigned char *)s->init_buf->data;\n\tif (s->state == st1)\n\t\t{\n\t\ti=ssl3_read_bytes(s,SSL3_RT_HANDSHAKE,&p[s->init_num],\n\t\t\t\t  4-s->init_num);\n\t\tif (i < (4-s->init_num))\n\t\t\t{\n\t\t\t*ok=0;\n\t\t\treturn(ssl3_part_read(s,i));\n\t\t\t}\n\t\tif ((mt >= 0) && (*p != mt))\n\t\t\t{\n\t\t\tal=SSL_AD_UNEXPECTED_MESSAGE;\n\t\t\tSSLerr(SSL_F_SSL3_GET_MESSAGE,SSL_R_UNEXPECTED_MESSAGE);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\tif((mt < 0) && (*p == SSL3_MT_CLIENT_HELLO) &&\n\t\t\t\t\t(st1 == SSL3_ST_SR_CERT_A) &&\n\t\t\t\t\t(stn == SSL3_ST_SR_CERT_B))\n\t\t\t{\n\t\t\tssl3_init_finished_mac(s);\n\t\t\tssl3_finish_mac(s, p + s->init_num, i);\n\t\t\t}\n\t\ts->s3->tmp.message_type= *(p++);\n\t\tn2l3(p,l);\n\t\tif (l > (unsigned long)max)\n\t\t\t{\n\t\t\tal=SSL_AD_ILLEGAL_PARAMETER;\n\t\t\tSSLerr(SSL_F_SSL3_GET_MESSAGE,SSL_R_EXCESSIVE_MESSAGE_SIZE);\n\t\t\tgoto f_err;\n\t\t\t}\n\t\tif (l && !BUF_MEM_grow(s->init_buf,(int)l))\n\t\t\t{\n\t\t\tSSLerr(SSL_F_SSL3_GET_MESSAGE,ERR_R_BUF_LIB);\n\t\t\tgoto err;\n\t\t\t}\n\t\ts->s3->tmp.message_size=l;\n\t\ts->state=stn;\n\t\ts->init_num=0;\n\t\t}\n\tp=(unsigned char *)s->init_buf->data;\n\tn=s->s3->tmp.message_size;\n\tif (n > 0)\n\t\t{\n\t\ti=ssl3_read_bytes(s,SSL3_RT_HANDSHAKE,&p[s->init_num],n);\n\t\tif (i != (int)n)\n\t\t\t{\n\t\t\t*ok=0;\n\t\t\treturn(ssl3_part_read(s,i));\n\t\t\t}\n\t\t}\n\t*ok=1;\n\treturn(n);\nf_err:\n\tssl3_send_alert(s,SSL3_AL_FATAL,al);\nerr:\n\t*ok=0;\n\treturn(-1);\n\t}', 'void ssl3_send_alert(SSL *s, int level, int desc)\n\t{\n\tdesc=s->method->ssl3_enc->alert_value(desc);\n\tif (desc < 0) return;\n\tif ((level == 2) && (s->session != NULL))\n\t\tSSL_CTX_remove_session(s->ctx,s->session);\n\ts->s3->alert_dispatch=1;\n\ts->s3->send_alert[0]=level;\n\ts->s3->send_alert[1]=desc;\n\tif (s->s3->wbuf.left == 0)\n\t\tssl3_dispatch_alert(s);\n\t}', 'int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)\n{\n\treturn remove_session_lock(ctx, c, 1);\n}', 'static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)\n\t{\n\tSSL_SESSION *r;\n\tint ret=0;\n\tif ((c != NULL) && (c->session_id_length != 0))\n\t\t{\n\t\tif(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);\n\t\tr=(SSL_SESSION *)lh_delete(ctx->sessions,c);\n\t\tif (r != NULL)\n\t\t\t{\n\t\t\tret=1;\n\t\t\tSSL_SESSION_list_remove(ctx,c);\n\t\t\t}\n\t\tif(lck) CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX);\n\t\tif (ret)\n\t\t\t{\n\t\t\tr->not_resumable=1;\n\t\t\tif (ctx->remove_session_cb != NULL)\n\t\t\t\tctx->remove_session_cb(ctx,r);\n\t\t\tSSL_SESSION_free(r);\n\t\t\t}\n\t\t}\n\telse\n\t\tret=0;\n\treturn(ret);\n\t}', 'void *lh_delete(LHASH *lh, void *data)\n\t{\n\tunsigned long hash;\n\tLHASH_NODE *nn,**rn;\n\tvoid *ret;\n\tlh->error=0;\n\trn=getrn(lh,data,&hash);\n\tif (*rn == NULL)\n\t\t{\n\t\tlh->num_no_delete++;\n\t\treturn(NULL);\n\t\t}\n\telse\n\t\t{\n\t\tnn= *rn;\n\t\t*rn=nn->next;\n\t\tret=nn->data;\n\t\tFree(nn);\n\t\tlh->num_delete++;\n\t\t}\n\tlh->num_items--;\n\tif ((lh->num_nodes > MIN_NODES) &&\n\t\t(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))\n\t\tcontract(lh);\n\treturn(ret);\n\t}', 'static void contract(LHASH *lh)\n\t{\n\tLHASH_NODE **n,*n1,*np;\n\tnp=lh->b[lh->p+lh->pmax-1];\n\tlh->b[lh->p+lh->pmax-1]=NULL;\n\tif (lh->p == 0)\n\t\t{\n\t\tn=(LHASH_NODE **)Realloc(lh->b,\n\t\t\t(unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));\n\t\tif (n == NULL)\n\t\t\t{\n\t\t\tlh->error++;\n\t\t\treturn;\n\t\t\t}\n\t\tlh->num_contract_reallocs++;\n\t\tlh->num_alloc_nodes/=2;\n\t\tlh->pmax/=2;\n\t\tlh->p=lh->pmax-1;\n\t\tlh->b=n;\n\t\t}\n\telse\n\t\tlh->p--;\n\tlh->num_nodes--;\n\tlh->num_contracts++;\n\tn1=lh->b[(int)lh->p];\n\tif (n1 == NULL)\n\t\tlh->b[(int)lh->p]=np;\n\telse\n\t\t{\n\t\twhile (n1->next != NULL)\n\t\t\tn1=n1->next;\n\t\tn1->next=np;\n\t\t}\n\t}']