From: Joey Pabalinas Date: Mon, 1 Jan 2018 20:40:14 +0000 (-1000) Subject: crypto: testmgr - change `guard` to unsigned char X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=da1729ce4866be266575a114208c7d5350bf310d;p=linux.git 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 Signed-off-by: Herbert Xu --- diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 29d7020b8826f..44a85d4b3561a 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(