aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/connection.h')
-rw-r--r--src/or/connection.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/connection.h b/src/or/connection.h
index 4d269d649a..adf79f1391 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -100,7 +100,7 @@ connection_get_inbuf_len(connection_t *conn)
IF_HAS_BUFFEREVENT(conn, {
return evbuffer_get_length(bufferevent_get_input(conn->bufev));
}) ELSE_IF_NO_BUFFEREVENT {
- return buf_datalen(conn->inbuf);
+ return conn->inbuf ? buf_datalen(conn->inbuf) : 0;
}
}
@@ -110,7 +110,7 @@ connection_get_outbuf_len(connection_t *conn)
IF_HAS_BUFFEREVENT(conn, {
return evbuffer_get_length(bufferevent_get_output(conn->bufev));
}) ELSE_IF_NO_BUFFEREVENT {
- return buf_datalen(conn->outbuf);
+ return conn->outbuf ? buf_datalen(conn->outbuf) : 0;
}
}