summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorJoey Pabalinas <joeypabalinas@gmail.com>2018-01-01 10:40:14 -1000
committerHerbert Xu <herbert@gondor.apana.org.au>2018-01-12 23:03:05 +1100
commit40b6b8ae2a3d759238651c27393035b794ea7b90 (patch)
treeca47a2449056d73893175072b6f2f5d1f18e697f /crypto
parent9ccd67a5d3370f458d7a90e38da9450e2ec7bf77 (diff)
downloadlinux-crypto-40b6b8ae2a3d759238651c27393035b794ea7b90.tar.gz
linux-crypto-40b6b8ae2a3d759238651c27393035b794ea7b90.zip
crypto: testmgr - change `guard` to unsigned char
When char is signed, storing the values 0xba (186) and 0xad (173) in the `guard` array produces signed overflow. Change the type of `guard` to static unsigned char to correct undefined behavior and reduce function stack usage. Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/testmgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 29d7020b..44a85d4b 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -185,7 +185,7 @@ static int ahash_partial_update(struct ahash_request **preq,
char *state;
struct ahash_request *req;
int statesize, ret = -EINVAL;
- const char guard[] = { 0x00, 0xba, 0xad, 0x00 };
+ static const unsigned char guard[] = { 0x00, 0xba, 0xad, 0x00 };
req = *preq;
statesize = crypto_ahash_statesize(