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>
This commit is contained in:
parent
7660b1fb36
commit
da1729ce48
1 changed files with 1 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue