tests/basic: fix signed interger overflow
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 14 May 2019 16:43:08 +0000 (19:43 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 15 May 2019 17:57:59 +0000 (20:57 +0300)
* tests/basic.c (check_ocb_cipher_largebuf_split): Cast to unsigned
when generating buffer values.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
tests/basic.c

index fd074cb..0ce88e2 100644 (file)
@@ -5044,7 +5044,7 @@ check_ocb_cipher_largebuf_split (int algo, int keylen, const char *tagexpect,
     }
 
   for (i = 0; i < buflen; i++)
-    inbuf[i] = (i + 181081) * 5039;
+    inbuf[i] = (unsigned int)(i + 181081) * 5039U;
 
   err = gcry_cipher_open (&hde, algo, GCRY_CIPHER_MODE_OCB, 0);
   if (!err)