From 2567f86986addc4b3f0851f83d32916a73fbce10 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
Date: Tue, 16 May 2017 15:23:07 +0200
Subject: [PATCH 3/4] _aes_set_key: ensure with assert() that nk is non-zero

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
---
 aes-set-key-internal.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/aes-set-key-internal.c b/aes-set-key-internal.c
index 9b515bf..88728d8 100644
--- a/aes-set-key-internal.c
+++ b/aes-set-key-internal.c
@@ -39,6 +39,7 @@
 #endif
 
 #include "aes-internal.h"
+#include <assert.h>
 #include "macros.h"
 
 void
@@ -52,6 +53,7 @@ _aes_set_key(unsigned nr, unsigned nk,
   unsigned lastkey, i;
   uint32_t t;
 
+  assert(nk != 0);
   lastkey = (AES_BLOCK_SIZE/4) * (nr + 1);
   
   for (i=0, rp = rcon; i<nk; i++)
-- 
2.9.3

