mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-07 06:59:19 +01:00
Replaced strcpy() with strncpy() in tests suites
This commit is contained in:
parent
b6487dade9
commit
dd0aae92e0
3 changed files with 16 additions and 18 deletions
|
|
@ -16,7 +16,7 @@ void md2_text( char *text_src_string, char *hex_hash_string )
|
|||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
|
||||
|
||||
md2( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
|
@ -36,7 +36,7 @@ void md4_text( char *text_src_string, char *hex_hash_string )
|
|||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
|
||||
|
||||
md4( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
|
@ -56,7 +56,7 @@ void md5_text( char *text_src_string, char *hex_hash_string )
|
|||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
|
||||
|
||||
md5( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
|
@ -76,7 +76,7 @@ void ripemd160_text( char *text_src_string, char *hex_hash_string )
|
|||
memset(hash_str, 0x00, sizeof hash_str);
|
||||
memset(output, 0x00, sizeof output);
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
|
||||
|
||||
ripemd160( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue