aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/buffers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 2ca05a0fce..d8a0e52583 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -290,9 +290,10 @@ int write_to_buf(const char *string, int string_len, buf_t *buf) {
assert(string && BUF_OK(buf));
- if (buf_ensure_capacity(buf, buf->datalen+string_len))
+ if (buf_ensure_capacity(buf, buf->datalen+string_len)) {
log_fn(LOG_WARN, "buflen too small, can't hold %d bytes.",buf->datalen+string_len);
return -1;
+ }
memcpy(buf->mem+buf->datalen, string, string_len);
buf->datalen += string_len;