mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-26 19:31:09 +00:00
unit tests: Fix potential buffer overflow
Fix potential buffer overflow when tracking the unmet dependencies of a test case. The identifiers of unmet dependencies are stored in an array of fixed size. Ensure that we don't overrun the array. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
59f2139df0
commit
1d3eab684c
|
@ -392,6 +392,9 @@ int main(int argc, const char *argv[])
|
||||||
for( i = 1; i < cnt; i++ )
|
for( i = 1; i < cnt; i++ )
|
||||||
{
|
{
|
||||||
if( dep_check( params[i] ) != DEPENDENCY_SUPPORTED )
|
if( dep_check( params[i] ) != DEPENDENCY_SUPPORTED )
|
||||||
|
{
|
||||||
|
if( unmet_dep_count <
|
||||||
|
ARRAY_LENGTH( unmet_dependencies ) )
|
||||||
{
|
{
|
||||||
if( 0 != option_verbose )
|
if( 0 != option_verbose )
|
||||||
{
|
{
|
||||||
|
@ -407,6 +410,7 @@ int main(int argc, const char *argv[])
|
||||||
unmet_dep_count++;
|
unmet_dep_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 )
|
if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 )
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue