mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-24 06:02:44 +00:00
Merge pull request #3155 from ronald-cron-arm/unmet-dependencies-buffer-overflow-fix
Unmet dependencies buffer overflow fix
This commit is contained in:
commit
5f69cbe2cc
@ -420,12 +420,15 @@ static void write_outcome_entry( FILE *outcome_file,
|
|||||||
* If this is \c NULL, this function does nothing.
|
* If this is \c NULL, this function does nothing.
|
||||||
* \param unmet_dep_count The number of unmet dependencies.
|
* \param unmet_dep_count The number of unmet dependencies.
|
||||||
* \param unmet_dependencies The array of unmet dependencies.
|
* \param unmet_dependencies The array of unmet dependencies.
|
||||||
|
* \param missing_unmet_dependencies Non-zero if there was a problem tracking
|
||||||
|
* all unmet dependencies, 0 otherwise.
|
||||||
* \param ret The test dispatch status (DISPATCH_xxx).
|
* \param ret The test dispatch status (DISPATCH_xxx).
|
||||||
* \param test_info A pointer to the test info structure.
|
* \param test_info A pointer to the test info structure.
|
||||||
*/
|
*/
|
||||||
static void write_outcome_result( FILE *outcome_file,
|
static void write_outcome_result( FILE *outcome_file,
|
||||||
size_t unmet_dep_count,
|
size_t unmet_dep_count,
|
||||||
int unmet_dependencies[],
|
int unmet_dependencies[],
|
||||||
|
int missing_unmet_dependencies,
|
||||||
int ret,
|
int ret,
|
||||||
const test_info_t *info )
|
const test_info_t *info )
|
||||||
{
|
{
|
||||||
@ -447,6 +450,8 @@ static void write_outcome_result( FILE *outcome_file,
|
|||||||
i == 0 ? ';' : ':',
|
i == 0 ? ';' : ':',
|
||||||
unmet_dependencies[i] );
|
unmet_dependencies[i] );
|
||||||
}
|
}
|
||||||
|
if( missing_unmet_dependencies )
|
||||||
|
mbedtls_fprintf( outcome_file, ":..." );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch( info->result )
|
switch( info->result )
|
||||||
@ -599,6 +604,7 @@ int execute_tests( int argc , const char ** argv )
|
|||||||
{
|
{
|
||||||
size_t unmet_dep_count = 0;
|
size_t unmet_dep_count = 0;
|
||||||
int unmet_dependencies[20];
|
int unmet_dependencies[20];
|
||||||
|
int missing_unmet_dependencies = 0;
|
||||||
|
|
||||||
test_filename = test_files[ testfile_index ];
|
test_filename = test_files[ testfile_index ];
|
||||||
|
|
||||||
@ -621,6 +627,7 @@ int execute_tests( int argc , const char ** argv )
|
|||||||
mbedtls_exit( MBEDTLS_EXIT_FAILURE );
|
mbedtls_exit( MBEDTLS_EXIT_FAILURE );
|
||||||
}
|
}
|
||||||
unmet_dep_count = 0;
|
unmet_dep_count = 0;
|
||||||
|
missing_unmet_dependencies = 0;
|
||||||
|
|
||||||
if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 )
|
if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 )
|
||||||
break;
|
break;
|
||||||
@ -646,10 +653,18 @@ int execute_tests( int argc , const char ** argv )
|
|||||||
{
|
{
|
||||||
int dep_id = strtol( params[i], NULL, 10 );
|
int dep_id = strtol( params[i], NULL, 10 );
|
||||||
if( dep_check( dep_id ) != DEPENDENCY_SUPPORTED )
|
if( dep_check( dep_id ) != DEPENDENCY_SUPPORTED )
|
||||||
|
{
|
||||||
|
if( unmet_dep_count <
|
||||||
|
ARRAY_LENGTH( unmet_dependencies ) )
|
||||||
{
|
{
|
||||||
unmet_dependencies[unmet_dep_count] = dep_id;
|
unmet_dependencies[unmet_dep_count] = dep_id;
|
||||||
unmet_dep_count++;
|
unmet_dep_count++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
missing_unmet_dependencies = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( ret = get_line( file, buf, sizeof( buf ) ) ) != 0 )
|
if( ( ret = get_line( file, buf, sizeof( buf ) ) ) != 0 )
|
||||||
@ -702,6 +717,7 @@ int execute_tests( int argc , const char ** argv )
|
|||||||
|
|
||||||
write_outcome_result( outcome_file,
|
write_outcome_result( outcome_file,
|
||||||
unmet_dep_count, unmet_dependencies,
|
unmet_dep_count, unmet_dependencies,
|
||||||
|
missing_unmet_dependencies,
|
||||||
ret, &test_info );
|
ret, &test_info );
|
||||||
if( unmet_dep_count > 0 || ret == DISPATCH_UNSUPPORTED_SUITE )
|
if( unmet_dep_count > 0 || ret == DISPATCH_UNSUPPORTED_SUITE )
|
||||||
{
|
{
|
||||||
@ -721,11 +737,14 @@ int execute_tests( int argc , const char ** argv )
|
|||||||
mbedtls_fprintf( stdout, "%d ",
|
mbedtls_fprintf( stdout, "%d ",
|
||||||
unmet_dependencies[i] );
|
unmet_dependencies[i] );
|
||||||
}
|
}
|
||||||
|
if( missing_unmet_dependencies )
|
||||||
|
mbedtls_fprintf( stdout, "..." );
|
||||||
}
|
}
|
||||||
mbedtls_fprintf( stdout, "\n" );
|
mbedtls_fprintf( stdout, "\n" );
|
||||||
fflush( stdout );
|
fflush( stdout );
|
||||||
|
|
||||||
unmet_dep_count = 0;
|
unmet_dep_count = 0;
|
||||||
|
missing_unmet_dependencies = 0;
|
||||||
}
|
}
|
||||||
else if( ret == DISPATCH_TEST_SUCCESS )
|
else if( ret == DISPATCH_TEST_SUCCESS )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user