summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2015-12-18 14:45:25 -0800
committerTom Marshall <tdm@cyngn.com>2016-01-04 10:26:54 -0800
commit139e798bf91cbe3e65c0c81e602ab5f6ee6d6085 (patch)
tree846b0081c471bbec69718b826969b09b6ea4865d
parent511152cd2c67e7f965fdbf451111522f898a2584 (diff)
downloadvendor_replicant-139e798bf91cbe3e65c0c81e602ab5f6ee6d6085.zip
vendor_replicant-139e798bf91cbe3e65c0c81e602ab5f6ee6d6085.tar.gz
vendor_replicant-139e798bf91cbe3e65c0c81e602ab5f6ee6d6085.tar.bz2
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
-rw-r--r--prebuilt/common/bin/otasigcheck.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/prebuilt/common/bin/otasigcheck.sh b/prebuilt/common/bin/otasigcheck.sh
index 99fdaec..aba53b0 100644
--- a/prebuilt/common/bin/otasigcheck.sh
+++ b/prebuilt/common/bin/otasigcheck.sh
@@ -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%% *}