mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 08:35:37 +01:00
Fix Wformat-overflow warning in ssl_mail_client.c
sprintf( (char *) buf, "%s\r\n", base ); Above code generates Wformat-overflow warning since both buf and base are of same size. buf should be sizeof( base ) + characters added in the format. In this case format 2 bytes for "\r\n".
This commit is contained in:
parent
5cb7017077
commit
58e9c1833b
@ -356,9 +356,11 @@ int main( int argc, char *argv[] )
|
|||||||
int ret = 1, len;
|
int ret = 1, len;
|
||||||
int exit_code = MBEDTLS_EXIT_FAILURE;
|
int exit_code = MBEDTLS_EXIT_FAILURE;
|
||||||
mbedtls_net_context server_fd;
|
mbedtls_net_context server_fd;
|
||||||
unsigned char buf[1024];
|
|
||||||
#if defined(MBEDTLS_BASE64_C)
|
#if defined(MBEDTLS_BASE64_C)
|
||||||
unsigned char base[1024];
|
unsigned char base[1024];
|
||||||
|
unsigned char buf[ sizeof( base ) + 2 ];
|
||||||
|
#else
|
||||||
|
unsigned char buf[1024];
|
||||||
#endif
|
#endif
|
||||||
char hostname[32];
|
char hostname[32];
|
||||||
const char *pers = "ssl_mail_client";
|
const char *pers = "ssl_mail_client";
|
||||||
|
Loading…
Reference in New Issue
Block a user