summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPatrick Steuer <patrick.steuer@de.ibm.com>2017-12-04 18:32:12 +0100
committerAndy Polyakov <appro@openssl.org>2017-12-09 21:44:00 +0100
commit397e23f8db5aecfaef4d470b0c421d2cd84da6f7 (patch)
tree7426eed5cbe71362376b9c9fd39dde1aca83a099 /apps
parent6b1fe3d059d8c5b3b86a7203faf59a7538fc9f0d (diff)
apps/speed.c: initialize buffers
Stop valgrind's complaints about uninitialized values. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4842)
Diffstat (limited to 'apps')
-rw-r--r--apps/speed.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/speed.c b/apps/speed.c
index 926778eced..4c6ee08160 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -1268,6 +1268,7 @@ int speed_main(int argc, char **argv)
long count = 0;
int size_num = OSSL_NELEM(lengths_list);
int keylen;
+ int buflen;
#ifndef NO_FORK
int multi = 0;
#endif
@@ -1605,12 +1606,12 @@ int speed_main(int argc, char **argv)
}
}
- loopargs[i].buf_malloc =
- app_malloc(lengths[size_num - 1] + MAX_MISALIGNMENT + 1,
- "input buffer");
- loopargs[i].buf2_malloc =
- app_malloc(lengths[size_num - 1] + MAX_MISALIGNMENT + 1,
- "input buffer");
+ buflen = lengths[size_num - 1] + MAX_MISALIGNMENT + 1;
+ loopargs[i].buf_malloc = app_malloc(buflen, "input buffer");
+ loopargs[i].buf2_malloc = app_malloc(buflen, "input buffer");
+ memset(loopargs[i].buf_malloc, 0, buflen);
+ memset(loopargs[i].buf2_malloc, 0, buflen);
+
/* Align the start of buffers on a 64 byte boundary */
loopargs[i].buf = loopargs[i].buf_malloc + misalign;
loopargs[i].buf2 = loopargs[i].buf2_malloc + misalign;