From 3b5191d36dd62af1a7c6e08ce3a171d189870b64 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Thu, 25 Sep 2003 10:42:07 +0000 Subject: 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 --- src/common/log.c | 10 ++++++---- src/common/tortls.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/common') 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; } } -- cgit v1.2.3