scripts: fixed an issue that could cause an infinite loop. [1/1]

PD#SWPL-12025

Problem:
the merge_pre_check.pl script has an bug that may enter an infinite loop,
causing problems.

Solution:
add the length of the detection conditions.

Verify:
local test.

Change-Id: I48fe839678ea0884a9082197eab083a2b8f489cd
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
This commit is contained in:
Jianxiong Pan
2019-07-30 09:57:56 +08:00
committed by Lawrence Mok
parent 602b5bf65b
commit 4b47fce393

View File

@@ -171,7 +171,7 @@ sub check_msg_49_2
}
$i += 1;
while( $str[$i] !~ /^Solution:[\n].+/ && $str[$i] !~ /^Change-Id:/ && $str[$i] !~ /^Verify:[\n].+/ )
while( $str[$i] !~ /^Solution:[\n].+/ && $str[$i] !~ /^Change-Id:/ && $str[$i] !~ /^Verify:[\n].+/ && ($i + 1) < $len)
{
$i = $i + 1;
}
@@ -189,7 +189,7 @@ sub check_msg_49_2
return -1;
}
while( $str[$i] !~ /^Verify:[\n].+/ && $str[$i] !~ /^Change-Id:/ )
while( $str[$i] !~ /^Verify:[\n].+/ && $str[$i] !~ /^Change-Id:/ && ($i + 1) < $len )
{
$i += 1;
}