summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-10-23 09:22:57 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-23 09:22:57 -0400
commit602f9565a932354c543353f5ab38079a8707b2ad (patch)
treef0d3bd346d5468c4214ef45da11ebb702a3d4bce
parent5f78775a8a1d1155fc14231c5a416ab23d3a02ab (diff)
parentaf33fdd7c1860399fe8d6861c163e5d64b0292b9 (diff)
downloadtor-602f9565a932354c543353f5ab38079a8707b2ad.tar.gz
tor-602f9565a932354c543353f5ab38079a8707b2ad.zip
Merge branch 'maint-0.3.1' into release-0.3.1
-rw-r--r--changes/bug239083
-rw-r--r--src/or/directory.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/changes/bug23908 b/changes/bug23908
new file mode 100644
index 0000000000..f641b66bb9
--- /dev/null
+++ b/changes/bug23908
@@ -0,0 +1,3 @@
+ o Minor bugfixes (directory authority, backport from 0.3.2.1-alpha):
+ - Remove the length limit on HTTP status lines that authorities can send
+ in their replies. Fixes bug 23499; bugfix on 0.3.1.6-rc.
diff --git a/src/or/directory.c b/src/or/directory.c
index 45fbd1dd33..bef65d3498 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -3282,14 +3282,12 @@ static void
write_http_status_line(dir_connection_t *conn, int status,
const char *reason_phrase)
{
- char buf[256];
- if (tor_snprintf(buf, sizeof(buf), "HTTP/1.0 %d %s\r\n\r\n",
- status, reason_phrase ? reason_phrase : "OK") < 0) {
- log_warn(LD_BUG,"status line too long.");
- return;
- }
+ char *buf = NULL;
+ tor_asprintf(&buf, "HTTP/1.0 %d %s\r\n\r\n",
+ status, reason_phrase ? reason_phrase : "OK");
log_debug(LD_DIRSERV,"Wrote status 'HTTP/1.0 %d %s'", status, reason_phrase);
connection_write_to_buf(buf, strlen(buf), TO_CONN(conn));
+ tor_free(buf);
}
/** Write the header for an HTTP/1.0 response onto <b>conn</b>-\>outbuf,