Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java	(revision 14892)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java	(revision 14893)
@@ -53,10 +53,9 @@
     }
 
-    public boolean ok() {
+    public void ok() {
         Main.pref.put("remotecontrol.permission.load-data", permissionLoadData.isSelected());
         Main.pref.put("remotecontrol.permission.change-selection", permissionChangeSelection.isSelected());
         Main.pref.put("remotecontrol.permission.change-viewport", permissionChangeViewport.isSelected());
         Main.pref.put("remotecontrol.always-confirm", alwaysAskUserConfirm.isSelected());
-        return false;
     }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 14892)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 14893)
@@ -75,5 +75,5 @@
 
             StringBuffer requestLine = new StringBuffer();
-            while (true)
+            while (requestLine.length() < 1024)
             {
                 int c = in.read();
@@ -85,8 +85,10 @@
             String get = requestLine.toString();
             StringTokenizer st = new StringTokenizer(get);
+            if (!st.hasMoreTokens()) { sendError(out); return; }
             String method = st.nextToken();
+            if (!st.hasMoreTokens()) { sendError(out); return; }
             String url = st.nextToken();
 
-            if(!method.equals("GET")) {
+            if (!method.equals("GET")) {
                 sendNotImplemented(out);
                 return;
