Commit 397e23f8 authored by Patrick Steuer's avatar Patrick Steuer Committed by Andy Polyakov
Browse files

apps/speed.c: initialize buffers



Stop valgrind's complaints about uninitialized values.

Signed-off-by: default avatarPatrick Steuer <patrick.steuer@de.ibm.com>

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4842)
parent 6b1fe3d0
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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;