Validate commands and arguments.
Bug: 5465176 Change-Id: I9402054c20ea6cae42781c35bfc2ade90aac31ce
This commit is contained in:
@@ -207,6 +207,13 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
|
|||||||
*/
|
*/
|
||||||
private void sendCommandLocked(String command, String argument)
|
private void sendCommandLocked(String command, String argument)
|
||||||
throws NativeDaemonConnectorException {
|
throws NativeDaemonConnectorException {
|
||||||
|
if (command != null && command.indexOf('\0') >= 0) {
|
||||||
|
throw new IllegalArgumentException("unexpected command: " + command);
|
||||||
|
}
|
||||||
|
if (argument != null && argument.indexOf('\0') >= 0) {
|
||||||
|
throw new IllegalArgumentException("unexpected argument: " + argument);
|
||||||
|
}
|
||||||
|
|
||||||
if (LOCAL_LOGD) Slog.d(TAG, String.format("SND -> {%s} {%s}", command, argument));
|
if (LOCAL_LOGD) Slog.d(TAG, String.format("SND -> {%s} {%s}", command, argument));
|
||||||
if (mOutputStream == null) {
|
if (mOutputStream == null) {
|
||||||
Slog.e(TAG, "No connection to daemon", new IllegalStateException());
|
Slog.e(TAG, "No connection to daemon", new IllegalStateException());
|
||||||
|
|||||||
Reference in New Issue
Block a user