From 1e24a87cc7b7e650b0a91c7ef59eb4b3b122abaa Mon Sep 17 00:00:00 2001 From: SN4T14 Date: Sun, 14 Jun 2015 01:31:14 +0000 Subject: [PATCH] Fixed arcfour.c initializing variables it wasn't supposed to, fixes #1 --- arcfour.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arcfour.c b/arcfour.c index 37a88e1..322b16d 100644 --- a/arcfour.c +++ b/arcfour.c @@ -32,11 +32,12 @@ void arcfour_key_setup(BYTE state[], const BYTE key[], int len) // stream starting from the first output byte. void arcfour_generate_stream(BYTE state[], BYTE out[], size_t len) { - int i, j; + int i = 0; + int j = 0; size_t idx; BYTE t; - for (idx = 0, i = 0, j = 0; idx < len; ++idx) { + for (idx = 0; idx < len; ++idx) { i = (i + 1) % 256; j = (j + state[i]) % 256; t = state[i];