mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-23 22:47:12 +01:00
Fix segfault
svn:r1895
This commit is contained in:
parent
1cfac90984
commit
ba14428d66
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue