mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 15:05:45 +01:00
Fix potential buffer overflow in suported_curves_ext
This commit is contained in:
parent
8505d50d4b
commit
8e205fc0bc
@ -231,7 +231,7 @@ static void ssl_write_supported_elliptic_curves_ext( ssl_context *ssl,
|
||||
size_t *olen )
|
||||
{
|
||||
unsigned char *p = buf;
|
||||
unsigned char elliptic_curve_list[20];
|
||||
unsigned char *elliptic_curve_list = p + 6;
|
||||
size_t elliptic_curve_len = 0;
|
||||
const ecp_curve_info *curve;
|
||||
((void) ssl);
|
||||
@ -260,8 +260,6 @@ static void ssl_write_supported_elliptic_curves_ext( ssl_context *ssl,
|
||||
*p++ = (unsigned char)( ( ( elliptic_curve_len ) >> 8 ) & 0xFF );
|
||||
*p++ = (unsigned char)( ( ( elliptic_curve_len ) ) & 0xFF );
|
||||
|
||||
memcpy( p, elliptic_curve_list, elliptic_curve_len );
|
||||
|
||||
*olen = 6 + elliptic_curve_len;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user