Skip to content
Snippets Groups Projects
Commit edd06b48 authored by Hans Boehm's avatar Hans Boehm Committed by Android (Google) Code Review
Browse files

Merge "Check hidden API exemptions" into sc-dev

parents 72edc588 60669aa4
No related branches found
No related tags found
No related merge requests found
......@@ -431,6 +431,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");
}
}
......@@ -972,6 +974,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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment