otasigcheck: Avoid long lines in XML
Shells based on busybox, such as found in CM 12.1 recovery and TWRP, do not properly handle pattern based parameter expansion for variables longer than 4kb. This throws our naive little XML parser into an infinite loop. Since all such lines are associated with external app certs, just skip them. Change-Id: I203b65c1ffd62bf3261b3ae315327314a5006952
This commit is contained in:
parent
511152cd2c
commit
139e798bf9
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,9 @@ if [ -f "/data/system/packages.xml" -a -f "/tmp/releasekey" ]; then
|
||||||
OLDIFS="$IFS"
|
OLDIFS="$IFS"
|
||||||
IFS=""
|
IFS=""
|
||||||
while read line; do
|
while read line; do
|
||||||
|
if [ "${#line}" -gt 4094 ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
params=${line# *<package *}
|
params=${line# *<package *}
|
||||||
if [ "$line" != "$params" ]; then
|
if [ "$line" != "$params" ]; then
|
||||||
kvp=${params%% *}
|
kvp=${params%% *}
|
||||||
|
|
Loading…
Reference in a new issue