pmac_init: prevent possible out of bounds access of polys[]
This commit is contained in:
parent
ea9b2a858a
commit
8652f33f35
@ -63,6 +63,9 @@ int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned l
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (poly >= (int)(sizeof(polys)/sizeof(polys[0]))) {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
if (polys[poly].len != pmac->block_len) {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user