]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: testmgr - fix sizeof() on COMP_BUF_SIZE
authorMichael Schupikov <michael@schupikov.de>
Sun, 7 Oct 2018 11:58:10 +0000 (13:58 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Oct 2018 06:20:45 +0000 (14:20 +0800)
commit70946d97d592031c91e64d62db5c5e07efc37925
treeef51d04023cc6f3ad80d18719a93a4bcde8fc68b
parentc1c03c7961d9307db1389598c4b8a3605b09c516
crypto: testmgr - fix sizeof() on COMP_BUF_SIZE

After allocation, output and decomp_output both point to memory chunks of
size COMP_BUF_SIZE. Then, only the first bytes are zeroed out using
sizeof(COMP_BUF_SIZE) as parameter to memset(), because
sizeof(COMP_BUF_SIZE) provides the size of the constant and not the size of
allocated memory.

Instead, the whole allocated memory is meant to be zeroed out. Use
COMP_BUF_SIZE as parameter to memset() directly in order to accomplish
this.

Fixes: a57dfed75a6fb ("crypto: testmgr - Allow different compression results")
Signed-off-by: Michael Schupikov <michael@schupikov.de>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c