aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-25 10:42:07 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-25 10:42:07 +0000
commit3b5191d36dd62af1a7c6e08ce3a171d189870b64 (patch)
tree8852c3a4b57e7c464e656c6a278bfe2fd2f5d862 /src/common
parent3d4ccb781ae5d74f0e16a63c89e08459d15cccf1 (diff)
downloadtor-3b5191d36dd62af1a7c6e08ce3a171d189870b64.tar
tor-3b5191d36dd62af1a7c6e08ce3a171d189870b64.tar.gz
various bugfixes and updates
redo all the config files for the new format (we'll redo them again soon) fix (another! yuck) segfault in log_fn when input is too large tor_tls_context_new() returns -1 for error, not NULL fix segfault in check_conn_marked() on conn's that die during tls handshake make ORs also initialize conn from router when we're the receiving node make non-dirserver ORs upload descriptor to every dirserver on startup add our local address to the descriptor add Content-Length field to POST command revert the Content-Length search in fetch_from_buf_http() to previous code fix segfault in memmove in fetch_from_buf_http() raise maximum allowed headers/body size in directory.c svn:r484
Diffstat (limited to 'src/common')
-rw-r--r--src/common/log.c10
-rw-r--r--src/common/tortls.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 0f75237c6..0b8a0bb38 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -54,17 +54,19 @@ static INLINE void format_msg(char *buf, size_t buf_len,
".%.3ld [%s] ",
(long)now.tv_usec / 1000, sev_to_string(severity));
if(n > buf_len)
- n = buf_len; /* the *nprintf funcs return how many bytes they
- * _would_ print, if the output is truncated */
+ n = buf_len-1; /* the *nprintf funcs return how many bytes they
+ * _would_ print, if the output is truncated.
+ * Subtract one because the count doesn't include the \0 */
+
if (funcname) {
n += snprintf(buf+n, buf_len-n, "%s(): ", funcname);
if(n > buf_len)
- n = buf_len;
+ n = buf_len-1;
}
n += vsnprintf(buf+n,buf_len-n,format,ap);
if(n > buf_len)
- n = buf_len;
+ n = buf_len-1;
buf[n]='\n';
buf[n+1]='\0';
}
diff --git a/src/common/tortls.c b/src/common/tortls.c
index a1d5b2c5e..1046b4981 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -215,7 +215,7 @@ tor_tls_context_new(crypto_pk_env_t *rsa,
cert = tor_tls_create_certificate(rsa, nickname);
if (!cert) {
log(LOG_ERR, "Error creating certificate");
- return NULL;
+ return -1;
}
}