diff options
| author | 2024-04-05 00:04:40 +0000 | |
|---|---|---|
| committer | 2024-04-05 00:04:40 +0000 | |
| commit | 6275a6252757696c7a018d67fc056beca8fc12bc (patch) | |
| tree | 76017ea6bcde7debdd6665095598bc610acf70e8 | |
| parent | 4dc4a6d7c0d3e982e9cee000ab080cf116abfca4 (diff) | |
| parent | a7e1cf21604a61340a0b43bd3383dfad5e2db044 (diff) | |
Merge "Check hidden API exemptions" into sc-dev am: edd06b486a am: 8627a9fa52 am: 1caafed45f am: 6e92ef1942 am: b54160fcb0 am: 9ae6eb428f am: a7e1cf2160
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/26721087
Change-Id: Ia3b250f01e548844cdec66f8e4727a69960be14d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | core/java/android/os/ZygoteProcess.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java index 3cb5c60259eb..2b84b25b92e2 100644 --- a/core/java/android/os/ZygoteProcess.java +++ b/core/java/android/os/ZygoteProcess.java @@ -424,6 +424,8 @@ public class ZygoteProcess { throw new ZygoteStartFailedEx("Embedded newlines not allowed"); } else if (arg.indexOf('\r') >= 0) { throw new ZygoteStartFailedEx("Embedded carriage returns not allowed"); + } else if (arg.indexOf('\u0000') >= 0) { + throw new ZygoteStartFailedEx("Embedded nulls not allowed"); } } @@ -959,6 +961,14 @@ public class ZygoteProcess { return true; } + for (/* NonNull */ String s : mApiDenylistExemptions) { + // indexOf() is intrinsified and faster than contains(). + if (s.indexOf('\n') >= 0 || s.indexOf('\r') >= 0 || s.indexOf('\u0000') >= 0) { + Slog.e(LOG_TAG, "Failed to set API denylist exemptions: Bad character"); + mApiDenylistExemptions = Collections.emptyList(); + return false; + } + } try { state.mZygoteOutputWriter.write(Integer.toString(mApiDenylistExemptions.size() + 1)); state.mZygoteOutputWriter.newLine(); |