commit 9dc568d2f275a2d923f8aad4281300e50b64da01
parent c815c8cededea0ae8cf31f6d7405f8cb6e024bda
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Fri, 16 Mar 2018 12:34:13 +0100
rely again on RNG.
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c
@@ -513,8 +513,8 @@ create_mhd_response_from_hr (struct HttpRequest *hr)
/**
- * Handle response payload data from cURL. Copies it into our `io_buf` to make
- * it available to MHD.
+ * Handle response payload data from cURL.
+ * Copies it into our `io_buf` to make it available to MHD.
*
* @param ptr pointer to the data
* @param size number of blocks of data
@@ -1151,7 +1151,8 @@ create_response (void *cls,
{
TALER_LOG_DEBUG
("Will (badly) truncate the request.\n");
- malformed_size = hr->io_len - TRUNC_SIZE;
+ malformed_size = GNUNET_CRYPTO_random_u32
+ (GNUNET_CRYPTO_QUALITY_WEAK, hr->io_len);
hr->io_len = malformed_size;
}
@@ -1378,7 +1379,8 @@ create_response (void *cls,
TALER_LOG_DEBUG
("Will (badly) truncate the response.\n");
- fake_len = hr->io_len - TRUNC_SIZE;
+ fake_len = GNUNET_CRYPTO_random_u32
+ (GNUNET_CRYPTO_QUALITY_WEAK, body_len);
body_len = fake_len;
malform = GNUNET_NO;
}
@@ -1388,6 +1390,7 @@ create_response (void *cls,
body,
MHD_RESPMEM_MUST_COPY);
+ GNUNET_free (body);
for (header = hr->header_head;
NULL != header;
header = header->next)