Loading core/java/android/net/PacProxySelector.java +2 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.net; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; Loading Loading @@ -74,8 +73,8 @@ public class PacProxySelector extends ProxySelector { } try { response = mProxyService.resolvePacFile(uri.getHost(), urlString); } catch (RemoteException e) { e.printStackTrace(); } catch (Exception e) { Log.e(TAG, "Error resolving PAC File", e); } if (response == null) { return mDefaultList; Loading packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java +8 −2 Original line number Diff line number Diff line Loading @@ -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"); } } Loading Loading
core/java/android/net/PacProxySelector.java +2 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.net; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; Loading Loading @@ -74,8 +73,8 @@ public class PacProxySelector extends ProxySelector { } try { response = mProxyService.resolvePacFile(uri.getHost(), urlString); } catch (RemoteException e) { e.printStackTrace(); } catch (Exception e) { Log.e(TAG, "Error resolving PAC File", e); } if (response == null) { return mDefaultList; Loading
packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java +8 −2 Original line number Diff line number Diff line Loading @@ -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"); } } Loading