diff options
author | Roger Dingledine <arma@torproject.org> | 2017-09-13 22:43:31 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2017-09-13 22:43:31 -0400 |
commit | dcd0aea85e9315c53a6b70a4a2b62ec65d539896 (patch) | |
tree | 54eaf65c9f4a8f5ab4520f08af5cf88cea827343 /src/or/directory.c | |
parent | 3247518f22833e507db40a8356b1e69044079ff0 (diff) | |
download | tor-dcd0aea85e9315c53a6b70a4a2b62ec65d539896.tar.gz tor-dcd0aea85e9315c53a6b70a4a2b62ec65d539896.zip |
get rid of a case where we might log a NULL as %s
this doesn't happen in our current code, and now it can't
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 89e2735e61..9551b41556 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3480,8 +3480,10 @@ write_http_status_line(dir_connection_t *conn, int status, const char *reason_phrase) { char buf[256]; + if (!reason_phrase) + reason_phrase = "unspecified"; if (tor_snprintf(buf, sizeof(buf), "HTTP/1.0 %d %s\r\n\r\n", - status, reason_phrase ? reason_phrase : "OK") < 0) { + status, reason_phrase) < 0) { log_warn(LD_BUG,"status line too long."); return; } |