summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-07-30 16:12:22 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-07-30 16:12:22 +0530
commit8d312646cb57359e89e99ae7e809c2da110babd6 (patch)
treeb949d9f7b85a853481865e4c36b0cef2421103e3
parentd335baac87c2c59796a543fc2df44e2db33f5e8e (diff)
fix SIGSEGV in GNUNET_buffer_write_data_encoded
-rw-r--r--src/util/buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/buffer.c b/src/util/buffer.c
index 2af972413..8fb10c2a5 100644
--- a/src/util/buffer.c
+++ b/src/util/buffer.c
@@ -265,7 +265,6 @@ GNUNET_buffer_write_data_encoded (struct GNUNET_Buffer *buf,
size_t len)
{
size_t outlen = len * 8;
- char *p = buf->mem + buf->position;
if (outlen % 5 > 0)
outlen += 5 - outlen % 5;
@@ -275,7 +274,8 @@ GNUNET_buffer_write_data_encoded (struct GNUNET_Buffer *buf,
GNUNET_assert (NULL !=
GNUNET_STRINGS_data_to_string (data,
len,
- p,
+ (buf->mem +
+ buf->position),
outlen));
buf->position += outlen;
GNUNET_assert (buf->position <= buf->capacity);