apps/s_client.c:976: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] (⇐ [0, +oo] + -1) Size: 8192 by call to `SSL_get_shared_ciphers`.
Showing all 6 steps of the trace


apps/s_client.c:908:1: Array declaration
906.   
907.   
908. > static void print_stuff(BIO *bio, SSL *s, int full)
909.   	{
910.   	X509 *peer=NULL;

apps/s_client.c:976:5: Call
974.   			BIO_printf(bio,"---\nNo client certificate CA names sent\n");
975.   			}
976.   		p=SSL_get_shared_ciphers(s,buf,sizeof buf);
           ^
977.   		if (p != NULL)
978.   			{

ssl/ssl_lib.c:1142:1: <Length trace>
1140.   
1141.   /* works well for SSLv2, not so good for SSLv3 */
1142. > char *SSL_get_shared_ciphers(SSL *s,char *buf,int len)
1143.   	{
1144.   	char *p;

ssl/ssl_lib.c:1142:1: Parameter `*buf`
  1140.   
  1141.   /* works well for SSLv2, not so good for SSLv3 */
  1142. > char *SSL_get_shared_ciphers(SSL *s,char *buf,int len)
  1143.   	{
  1144.   	char *p;

ssl/ssl_lib.c:1154:2: Assignment
  1152.   		return(NULL);
  1153.   
  1154.   	p=buf;
           ^
  1155.   	sk=s->session->ciphers;
  1156.   	for (i=0; i<sk_SSL_CIPHER_num(sk); i++)

ssl/ssl_lib.c:1173:2: Array access: Offset: [-1, +oo] (⇐ [0, +oo] + -1) Size: 8192 by call to `SSL_get_shared_ciphers` 
  1171.   		*(p++)=':';
  1172.   		}
  1173.   	p[-1]='\0';
           ^
  1174.   	return(buf);
  1175.   	}

char *SSL_get_shared_ciphers(SSL *s,char *buf,int len)
	{
	char *p;
	const char *cp;
	STACK_OF(SSL_CIPHER) *sk;
	SSL_CIPHER *c;
	int i;
	if ((s->session == NULL) || (s->session->ciphers == NULL) ||
		(len < 2))
		return(NULL);
	p=buf;
	sk=s->session->ciphers;
	for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
		{
		len--;
		c=sk_SSL_CIPHER_value(sk,i);
		for (cp=c->name; *cp; )
			{
			if (len-- == 0)
				{
				*p='\0';
				return(buf);
				}
			else
				*(p++)= *(cp++);
			}
		*(p++)=':';
		}
	p[-1]='\0';
	return(buf);
	}
['static void print_stuff(BIO *bio, SSL *s, int full)\n\t{\n\tX509 *peer=NULL;\n\tchar *p;\n\tstatic char *space="                ";\n\tchar buf[BUFSIZ];\n\tSTACK_OF(X509) *sk;\n\tSTACK_OF(X509_NAME) *sk2;\n\tSSL_CIPHER *c;\n\tX509_NAME *xn;\n\tint j,i;\n\tif (full)\n\t\t{\n\t\tint got_a_chain = 0;\n\t\tsk=SSL_get_peer_cert_chain(s);\n\t\tif (sk != NULL)\n\t\t\t{\n\t\t\tgot_a_chain = 1;\n\t\t\tBIO_printf(bio,"---\\nCertificate chain\\n");\n\t\t\tfor (i=0; i<sk_X509_num(sk); i++)\n\t\t\t\t{\n\t\t\t\tX509_NAME_oneline(X509_get_subject_name(\n\t\t\t\t\tsk_X509_value(sk,i)),buf,sizeof buf);\n\t\t\t\tBIO_printf(bio,"%2d s:%s\\n",i,buf);\n\t\t\t\tX509_NAME_oneline(X509_get_issuer_name(\n\t\t\t\t\tsk_X509_value(sk,i)),buf,sizeof buf);\n\t\t\t\tBIO_printf(bio,"   i:%s\\n",buf);\n\t\t\t\tif (c_showcerts)\n\t\t\t\t\tPEM_write_bio_X509(bio,sk_X509_value(sk,i));\n\t\t\t\t}\n\t\t\t}\n\t\tBIO_printf(bio,"---\\n");\n\t\tpeer=SSL_get_peer_certificate(s);\n\t\tif (peer != NULL)\n\t\t\t{\n\t\t\tBIO_printf(bio,"Server certificate\\n");\n\t\t\tif (!(c_showcerts && got_a_chain))\n\t\t\t\tPEM_write_bio_X509(bio,peer);\n\t\t\tX509_NAME_oneline(X509_get_subject_name(peer),\n\t\t\t\tbuf,sizeof buf);\n\t\t\tBIO_printf(bio,"subject=%s\\n",buf);\n\t\t\tX509_NAME_oneline(X509_get_issuer_name(peer),\n\t\t\t\tbuf,sizeof buf);\n\t\t\tBIO_printf(bio,"issuer=%s\\n",buf);\n\t\t\t}\n\t\telse\n\t\t\tBIO_printf(bio,"no peer certificate available\\n");\n\t\tsk2=SSL_get_client_CA_list(s);\n\t\tif ((sk2 != NULL) && (sk_X509_NAME_num(sk2) > 0))\n\t\t\t{\n\t\t\tBIO_printf(bio,"---\\nAcceptable client certificate CA names\\n");\n\t\t\tfor (i=0; i<sk_X509_NAME_num(sk2); i++)\n\t\t\t\t{\n\t\t\t\txn=sk_X509_NAME_value(sk2,i);\n\t\t\t\tX509_NAME_oneline(xn,buf,sizeof(buf));\n\t\t\t\tBIO_write(bio,buf,strlen(buf));\n\t\t\t\tBIO_write(bio,"\\n",1);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tBIO_printf(bio,"---\\nNo client certificate CA names sent\\n");\n\t\t\t}\n\t\tp=SSL_get_shared_ciphers(s,buf,sizeof buf);\n\t\tif (p != NULL)\n\t\t\t{\n\t\t\tBIO_printf(bio,"---\\nCiphers common between both SSL endpoints:\\n");\n\t\t\tj=i=0;\n\t\t\twhile (*p)\n\t\t\t\t{\n\t\t\t\tif (*p == \':\')\n\t\t\t\t\t{\n\t\t\t\t\tBIO_write(bio,space,15-j%25);\n\t\t\t\t\ti++;\n\t\t\t\t\tj=0;\n\t\t\t\t\tBIO_write(bio,((i%3)?" ":"\\n"),1);\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tBIO_write(bio,p,1);\n\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\tp++;\n\t\t\t\t}\n\t\t\tBIO_write(bio,"\\n",1);\n\t\t\t}\n\t\tBIO_printf(bio,"---\\nSSL handshake has read %ld bytes and written %ld bytes\\n",\n\t\t\tBIO_number_read(SSL_get_rbio(s)),\n\t\t\tBIO_number_written(SSL_get_wbio(s)));\n\t\t}\n\tBIO_printf(bio,((s->hit)?"---\\nReused, ":"---\\nNew, "));\n\tc=SSL_get_current_cipher(s);\n\tBIO_printf(bio,"%s, Cipher is %s\\n",\n\t\tSSL_CIPHER_get_version(c),\n\t\tSSL_CIPHER_get_name(c));\n\tif (peer != NULL) {\n\t\tEVP_PKEY *pktmp;\n\t\tpktmp = X509_get_pubkey(peer);\n\t\tBIO_printf(bio,"Server public key is %d bit\\n",\n\t\t\t\t\t\t\t EVP_PKEY_bits(pktmp));\n\t\tEVP_PKEY_free(pktmp);\n\t}\n\tSSL_SESSION_print(bio,SSL_get_session(s));\n\tBIO_printf(bio,"---\\n");\n\tif (peer != NULL)\n\t\tX509_free(peer);\n\tBIO_flush(bio);\n\t}', "char *SSL_get_shared_ciphers(SSL *s,char *buf,int len)\n\t{\n\tchar *p;\n\tconst char *cp;\n\tSTACK_OF(SSL_CIPHER) *sk;\n\tSSL_CIPHER *c;\n\tint i;\n\tif ((s->session == NULL) || (s->session->ciphers == NULL) ||\n\t\t(len < 2))\n\t\treturn(NULL);\n\tp=buf;\n\tsk=s->session->ciphers;\n\tfor (i=0; i<sk_SSL_CIPHER_num(sk); i++)\n\t\t{\n\t\tlen--;\n\t\tc=sk_SSL_CIPHER_value(sk,i);\n\t\tfor (cp=c->name; *cp; )\n\t\t\t{\n\t\t\tif (len-- == 0)\n\t\t\t\t{\n\t\t\t\t*p='\\0';\n\t\t\t\treturn(buf);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t*(p++)= *(cp++);\n\t\t\t}\n\t\t*(p++)=':';\n\t\t}\n\tp[-1]='\\0';\n\treturn(buf);\n\t}"]