From: Julius Bünger Date: Thu, 25 Oct 2018 12:49:12 +0000 (+0200) Subject: RPS utils: Use proper size for writing to file X-Git-Tag: v0.11.0~238^2~22 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=978440fd8f5d44114fa538e75eed74c65ef4b957;p=oweals%2Fgnunet.git RPS utils: Use proper size for writing to file --- diff --git a/src/rps/rps-test_util.h b/src/rps/rps-test_util.h index 11093420e..a806f11cd 100644 --- a/src/rps/rps-test_util.h +++ b/src/rps/rps-test_util.h @@ -49,7 +49,7 @@ create_file (const char *name); GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\ "Failed to create tmp_buf\n");\ else\ - GNUNET_DISK_fn_write(file_name,tmp_buf, sizeof(tmp_buf),\ + GNUNET_DISK_fn_write(file_name, tmp_buf, strnlen(tmp_buf, 512),\ GNUNET_DISK_PERM_USER_READ |\ GNUNET_DISK_PERM_USER_WRITE |\ GNUNET_DISK_PERM_GROUP_READ |\ @@ -64,7 +64,7 @@ create_file (const char *name); GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\ "Failed to create tmp_buf\n");\ else\ - GNUNET_DISK_fn_write(file_name,tmp_buf, len, \ + GNUNET_DISK_fn_write(file_name, tmp_buf, strnlen(tmp_buf, len), \ GNUNET_DISK_PERM_USER_READ |\ GNUNET_DISK_PERM_USER_WRITE |\ GNUNET_DISK_PERM_GROUP_READ |\