From 139e798bf91cbe3e65c0c81e602ab5f6ee6d6085 Mon Sep 17 00:00:00 2001 From: Tom Marshall Date: Fri, 18 Dec 2015 14:45:25 -0800 Subject: [PATCH] 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 --- prebuilt/common/bin/otasigcheck.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prebuilt/common/bin/otasigcheck.sh b/prebuilt/common/bin/otasigcheck.sh index 99fdaec2..aba53b01 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# *