[or-cvs] Fix segfault
Nick Mathewson
nickm at seul.org
Wed May 19 19:28:27 UTC 2004
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv32710/src/or
Modified Files:
buffers.c
Log Message:
Fix segfault
Index: buffers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/buffers.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- buffers.c 18 May 2004 15:35:21 -0000 1.93
+++ buffers.c 19 May 2004 19:28:24 -0000 1.94
@@ -94,9 +94,9 @@
/** 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;
}
More information about the tor-commits
mailing list