From: Nick Mathewson Date: Wed, 19 May 2004 19:28:24 +0000 (+0000) Subject: Fix segfault X-Git-Tag: tor-0.0.7rc1~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba14428d664e3877d29e74087f326620146a15cb;p=thirdparty%2Ftor.git Fix segfault svn:r1895 --- diff --git a/src/or/buffers.c b/src/or/buffers.c index 8acab16a6e..a67f47bee5 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -94,9 +94,9 @@ static INLINE void buf_remove_from_front(buf_t *buf, size_t n) { /** Make sure that the memory in buf ends with a zero byte. */ static INLINE int buf_nul_terminate(buf_t *buf) { - if (buf_ensure_capacity(buf,buf->len+1)<0) + if (buf_ensure_capacity(buf,buf->datalen+1)<0) return -1; - buf->mem[buf->len] = '\0'; + buf->mem[buf->datalen] = '\0'; return 0; }