diff options
author | Andy Polyakov <appro@openssl.org> | 2018-05-21 14:26:54 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2018-05-30 18:26:51 +0200 |
commit | 2fc45cb805f85589bb49c3669864152e909696da (patch) | |
tree | 23a51627c1f9d972e291e1c940ca41e0c06f795b | |
parent | 44ca7565a6c73cbff17ee94c9f83b871c8c91445 (diff) |
apps/speed.c: address asan failure with small -bytes and large -misalign.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6311)
-rw-r--r-- | apps/speed.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/speed.c b/apps/speed.c index 3af6971a1a..768e3a1ad3 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -1690,7 +1690,10 @@ int speed_main(int argc, char **argv) } } - buflen = lengths[size_num - 1] + MAX_MISALIGNMENT + 1; + buflen = lengths[size_num - 1]; + if (buflen < 36) /* size of random vector in RSA bencmark */ + buflen = 36; + buflen += 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); |