aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parentd335baac87c2c59796a543fc2df44e2db33f5e8e (diff)
downloadgnunet-8d312646cb57359e89e99ae7e809c2da110babd6.tar.gz
gnunet-8d312646cb57359e89e99ae7e809c2da110babd6.zip
fix SIGSEGV in GNUNET_buffer_write_data_encoded
Diffstat (limited to 'src')
-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,
265 size_t len) 265 size_t len)
266{ 266{
267 size_t outlen = len * 8; 267 size_t outlen = len * 8;
268 char *p = buf->mem + buf->position;
269 268
270 if (outlen % 5 > 0) 269 if (outlen % 5 > 0)
271 outlen += 5 - outlen % 5; 270 outlen += 5 - outlen % 5;
@@ -275,7 +274,8 @@ GNUNET_buffer_write_data_encoded (struct GNUNET_Buffer *buf,
275 GNUNET_assert (NULL != 274 GNUNET_assert (NULL !=
276 GNUNET_STRINGS_data_to_string (data, 275 GNUNET_STRINGS_data_to_string (data,
277 len, 276 len,
278 p, 277 (buf->mem +
278 buf->position),
279 outlen)); 279 outlen));
280 buf->position += outlen; 280 buf->position += outlen;
281 GNUNET_assert (buf->position <= buf->capacity); 281 GNUNET_assert (buf->position <= buf->capacity);