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:
Tom Marshall 2015-12-18 14:45:25 -08:00
parent 511152cd2c
commit 139e798bf9

View file

@ -20,6 +20,9 @@ if [ -f "/data/system/packages.xml" -a -f "/tmp/releasekey" ]; then
OLDIFS="$IFS"
IFS=""
while read line; do
if [ "${#line}" -gt 4094 ]; then
continue
fi
params=${line# *<package *}
if [ "$line" != "$params" ]; then
kvp=${params%% *}