Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8134ff3 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Automerger Merge Worker
Browse files

Fix potential stack overflow caused by integer overflow am: c45ee0e1

Change-Id: Ia8ae7d5d144e3a5e94728dc236d9e7af6ddd3dd2
parents 297bd81c c45ee0e1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -180,7 +180,8 @@ static void cmac_generate_subkey(const Octet16& key) {
 *  length - length of the input in byte.
 */
Octet16 aes_cmac(const Octet16& key, const uint8_t* input, uint16_t length) {
  uint16_t len, diff;
  uint32_t len;
  uint16_t diff;
  /* n is number of rounds */
  uint16_t n = (length + OCTET16_LEN - 1) / OCTET16_LEN;