Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00a38cee authored by Andy Mast's avatar Andy Mast
Browse files

Avoid calling idmap w/ trailing whitespace [1/2]

installd performs a buffer over-read if trailing ws is sent to it.
No observable effect found yet for idmap, but until installd is
fixed upstream, best to play it safe.

Change-Id: I56c9b4bd956ca6f59935253c6d2c90c4dba0ae94
parent e971d05c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -345,7 +345,12 @@ public final class Installer {

    public int idmap(String targetApkPath, String overlayApkPath, String redirectionsPath, int uid,
                     int targetHash, int overlayHash) {
        StringBuilder builder = new StringBuilder("idmap");
        StringBuilder builder = new StringBuilder();
        if (TextUtils.isEmpty(redirectionsPath)) {
            builder.append("idmap");
        } else {
            builder.append("idmap_with_redirs");
        }
        builder.append(' ');
        builder.append(targetApkPath);
        builder.append(' ');
@@ -356,7 +361,7 @@ public final class Installer {
        builder.append(targetHash);
        builder.append(' ');
        builder.append(overlayHash);
        if (redirectionsPath != null) {
        if (!TextUtils.isEmpty(redirectionsPath)) {
            builder.append(' ');
            builder.append(redirectionsPath);
        }