Merge branch 'maint-0.2.2' into release-0.2.2

This commit is contained in:
Roger Dingledine 2011-12-08 17:23:58 -05:00
commit 9fdfc10092
10 changed files with 6688 additions and 3779 deletions

5
changes/bug4529 Normal file
View File

@ -0,0 +1,5 @@
o Minor bufixes:
- If we had ever tried to call tor_addr_to_str on an address of
unknown type, we would have done a strdup on an uninitialized
buffer. Now we won't. Fixes bug 4529; bugfix on 0.2.1.3-alpha.
Reported by "troll_un".

6
changes/bug4530 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes:
- Correctly detect and handle transient lookup failures from
tor_addr_lookup. Fixes bug 4530; bugfix on 0.2.1.5-alpha.
Reported by "troll_un".

4
changes/bug4531 Normal file
View File

@ -0,0 +1,4 @@
o Major bugfixes:
- Fix null-pointer access that could occur if TLS allocation failed.
Fixes bug 4531; bugfix on 0.2.0.20-rc. Found by "troll_un".

3
changes/bug4535 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes:
- Use tor_socket_t type for listener argument to accept(). Fixes bug
4535; bugfix on 0.2.2.28-beta. Found by "troll_un".

View File

@ -0,0 +1,3 @@
o Minor features:
- Update to the December 6 2011 Maxmind GeoLite Country database.

View File

@ -945,8 +945,11 @@ char *
tor_dup_addr(const tor_addr_t *addr)
{
char buf[TOR_ADDR_BUF_LEN];
tor_addr_to_str(buf, addr, sizeof(buf), 0);
return tor_strdup(buf);
if (tor_addr_to_str(buf, addr, sizeof(buf), 0)) {
return tor_strdup(buf);
} else {
return tor_strdup("<unknown address type>");
}
}
/** Return a string representing the address <b>addr</b>. This string is
@ -1031,7 +1034,7 @@ tor_addr_port_parse(const char *s, tor_addr_t *addr_out, uint16_t *port_out)
++port;
}
if (tor_addr_lookup(tmp, AF_UNSPEC, &addr) < 0)
if (tor_addr_lookup(tmp, AF_UNSPEC, &addr) != 0)
goto err;
tor_free(tmp);

View File

@ -934,7 +934,7 @@ tor_open_socket(int domain, int type, int protocol)
/** As socket(), but counts the number of open sockets. */
tor_socket_t
tor_accept_socket(int sockfd, struct sockaddr *addr, socklen_t *len)
tor_accept_socket(tor_socket_t sockfd, struct sockaddr *addr, socklen_t *len)
{
tor_socket_t s = accept(sockfd, addr, len);
if (SOCKET_OK(s)) {

View File

@ -404,7 +404,7 @@ typedef int socklen_t;
int tor_close_socket(tor_socket_t s);
tor_socket_t tor_open_socket(int domain, int type, int protocol);
tor_socket_t tor_accept_socket(int sockfd, struct sockaddr *addr,
tor_socket_t tor_accept_socket(tor_socket_t sockfd, struct sockaddr *addr,
socklen_t *len);
int get_n_open_sockets(void);

File diff suppressed because it is too large Load Diff

View File

@ -871,12 +871,12 @@ connection_tls_start_handshake(or_connection_t *conn, int receiving)
{
conn->_base.state = OR_CONN_STATE_TLS_HANDSHAKING;
conn->tls = tor_tls_new(conn->_base.s, receiving);
tor_tls_set_logged_address(conn->tls, // XXX client and relay?
escaped_safe_str(conn->_base.address));
if (!conn->tls) {
log_warn(LD_BUG,"tor_tls_new failed. Closing.");
return -1;
}
tor_tls_set_logged_address(conn->tls, // XXX client and relay?
escaped_safe_str(conn->_base.address));
connection_start_reading(TO_CONN(conn));
log_debug(LD_HANDSHAKE,"starting TLS handshake on fd %d", conn->_base.s);
note_crypto_pk_op(receiving ? TLS_HANDSHAKE_S : TLS_HANDSHAKE_C);