Author: toad
Date: 2008-02-15 15:09:45 +0000 (Fri, 15 Feb 2008)
New Revision: 17941

Modified:
   trunk/freenet/src/freenet/node/TextModeClientInterface.java
Log:
Don't allow PROBE:-1

Modified: trunk/freenet/src/freenet/node/TextModeClientInterface.java
===================================================================
--- trunk/freenet/src/freenet/node/TextModeClientInterface.java 2008-02-15 
14:59:03 UTC (rev 17940)
+++ trunk/freenet/src/freenet/node/TextModeClientInterface.java 2008-02-15 
15:09:45 UTC (rev 17941)
@@ -838,6 +838,10 @@
         } else if(uline.startsWith("PROBE:")) {
                String s = uline.substring("PROBE:".length()).trim();
                double d = Double.parseDouble(s);
+               if(d > 1.0 || d < 0.0) {
+                       System.err.println("Unacceptable target location: "+d);
+                       return false;
+               }
                ProbeCallback cb = new ProbeCallback() {
                                public void onCompleted(String reason, double 
target, double best, double nearest, long id, short counter, short 
uniqueCounter, short linearCounter) {
                                        String msg = "Completed probe request: 
"+target+" -> "+best+"\r\nNearest actually hit "+nearest+", "+counter+" nodes 
("+uniqueCounter+" unique, "+linearCounter+" hops), id "+id+"\r\n";


Reply via email to