Fix bug introduced in dbf69cf

(Was writing outside array bounds.)
This commit is contained in:
Manuel Pégourié-Gonnard 2013-08-23 12:18:46 +02:00
parent df0142bd17
commit 9c9812a299

View file

@ -134,7 +134,7 @@ static void ssl_write_signature_algorithms_ext( ssl_context *ssl,
size_t *olen )
{
unsigned char *p = buf;
unsigned char sig_alg_list[20];
unsigned char *sig_alg_list = buf + 6;
size_t sig_alg_len = 0;
*olen = 0;
@ -218,8 +218,6 @@ static void ssl_write_signature_algorithms_ext( ssl_context *ssl,
*p++ = (unsigned char)( ( sig_alg_len >> 8 ) & 0xFF );
*p++ = (unsigned char)( ( sig_alg_len ) & 0xFF );
memcpy( p, sig_alg_list, sig_alg_len );
*olen = 6 + sig_alg_len;
}