[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [flashproxy/master] Fix error handling for the "local" parameter.



commit 2958b2292d5517649087b1237af4e9bdd7eb65e7
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Sun Jul 17 11:23:49 2011 -0700

    Fix error handling for the "local" parameter.
    
    get_param_addr already handles a default value. It signals a parsing
    error if the supplied value has a syntax error.
---
 swfcat.as |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/swfcat.as b/swfcat.as
index 5be06fd..80916c8 100644
--- a/swfcat.as
+++ b/swfcat.as
@@ -106,10 +106,11 @@ package
                 return;
             }
 
-            if (this.loaderInfo.parameters["local"])
-                local_addr = get_param_addr("local", DEFAULT_LOCAL_TOR_CLIENT_ADDR);
-            else
-                local_addr = DEFAULT_LOCAL_TOR_CLIENT_ADDR;
+            local_addr = get_param_addr("local", DEFAULT_LOCAL_TOR_CLIENT_ADDR);
+            if (!local_addr) {
+                puts("Error: Local spec must be in the form \"host:port\".");
+                return;
+            }
 
             if (this.loaderInfo.parameters["client"])
                 client_main();

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits