Explorar el Código

remove some dead code. some of it was tickling coverity.

Roger Dingledine hace 16 años
padre
commit
746a19e84d
Se han modificado 2 ficheros con 0 adiciones y 21 borrados
  1. 0 2
      ChangeLog
  2. 0 19
      src/or/connection_edge.c

+ 0 - 2
ChangeLog

@@ -25,8 +25,6 @@ Changes in version 0.2.2.4-alpha - 2009-10-??
       on 0.2.2.1-alpha.
       on 0.2.2.1-alpha.
     - Fix two memory leaks in the error case of
     - Fix two memory leaks in the error case of
       circuit_build_times_parse_state. Bugfix on 0.2.2.2-alpha.
       circuit_build_times_parse_state. Bugfix on 0.2.2.2-alpha.
-    - Make it explicit that we can't overflow in
-      connection_ap_handshake_send_resolve. Bugfix on 0.0.7.1.
     - Don't count one-hop circuits when we're estimating how long it
     - Don't count one-hop circuits when we're estimating how long it
       takes circuits to build on average. Otherwise we'll set our circuit
       takes circuits to build on average. Otherwise we'll set our circuit
       build timeout lower than we should. Bugfix on 0.2.2.2-alpha.
       build timeout lower than we should. Bugfix on 0.2.2.2-alpha.

+ 0 - 19
src/or/connection_edge.c

@@ -1547,18 +1547,6 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
       uint32_t answer;
       uint32_t answer;
       struct in_addr in;
       struct in_addr in;
       /* Reply to resolves immediately if we can. */
       /* Reply to resolves immediately if we can. */
-      if (strlen(socks->address) > RELAY_PAYLOAD_SIZE) {
-        log_warn(LD_APP,"Address to be resolved is too large. Failing.");
-        control_event_client_status(LOG_WARN, "SOCKS_BAD_HOSTNAME HOSTNAME=%s",
-                                    escaped(socks->address));
-        connection_ap_handshake_socks_resolved(conn,
-                                               RESOLVED_TYPE_ERROR_TRANSIENT,
-                                               0,NULL,-1,TIME_MAX);
-        connection_mark_unattached_ap(conn,
-                                END_STREAM_REASON_SOCKSPROTOCOL |
-                                END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED);
-        return -1;
-      }
       if (tor_inet_aton(socks->address, &in)) { /* see if it's an IP already */
       if (tor_inet_aton(socks->address, &in)) { /* see if it's an IP already */
         /* leave it in network order */
         /* leave it in network order */
         answer = in.s_addr;
         answer = in.s_addr;
@@ -2156,13 +2144,6 @@ connection_ap_handshake_send_resolve(edge_connection_t *ap_conn)
     tor_assert(payload_len <= (int)sizeof(inaddr_buf));
     tor_assert(payload_len <= (int)sizeof(inaddr_buf));
   }
   }
 
 
-  if (payload_len > MAX_SOCKS_ADDR_LEN) {
-    /* This should be impossible: we don't accept addresses this big. */
-    /* XXX Should we log a bug here? */
-    connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_INTERNAL);
-    return -1;
-  }
-
   log_debug(LD_APP,
   log_debug(LD_APP,
             "Sending relay cell to begin stream %d.", ap_conn->stream_id);
             "Sending relay cell to begin stream %d.", ap_conn->stream_id);