summaryrefslogtreecommitdiffstats
path: root/packages/services
diff options
context:
space:
mode:
Diffstat (limited to 'packages/services')
-rw-r--r--packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java10
-rw-r--r--packages/services/Proxy/src/com/android/proxyhandler/ProxyService.java2
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java b/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java
index c6b76f1..74391eb 100644
--- a/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java
+++ b/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java
@@ -72,16 +72,22 @@ public class PacService extends Service {
@Override
public String resolvePacFile(String host, String url) throws RemoteException {
try {
+ if (host == null) {
+ throw new IllegalArgumentException("The host must not be null");
+ }
+ if (url == null) {
+ throw new IllegalArgumentException("The URL must not be null");
+ }
// Check for characters that could be used for an injection attack.
new URL(url);
for (char c : host.toCharArray()) {
if (!Character.isLetterOrDigit(c) && (c != '.') && (c != '-')) {
- throw new RemoteException("Invalid host was passed");
+ throw new IllegalArgumentException("Invalid host was passed");
}
}
return mPacNative.makeProxyRequest(url, host);
} catch (MalformedURLException e) {
- throw new RemoteException("Invalid URL was passed");
+ throw new IllegalArgumentException("Invalid URL was passed");
}
}
diff --git a/packages/services/Proxy/src/com/android/proxyhandler/ProxyService.java b/packages/services/Proxy/src/com/android/proxyhandler/ProxyService.java
index cbea188..970fdc7 100644
--- a/packages/services/Proxy/src/com/android/proxyhandler/ProxyService.java
+++ b/packages/services/Proxy/src/com/android/proxyhandler/ProxyService.java
@@ -33,8 +33,6 @@ public class ProxyService extends Service {
/** Keep these values up-to-date with PacManager.java */
public static final String KEY_PROXY = "keyProxy";
public static final String HOST = "localhost";
- // STOPSHIP This being a static port means it can be hijacked by other apps.
- public static final int PORT = 8182;
public static final String EXCL_LIST = "";
@Override