diff --git a/sys/crypto/rc4/rc4.c b/sys/crypto/rc4/rc4.c --- a/sys/crypto/rc4/rc4.c +++ b/sys/crypto/rc4/rc4.c @@ -39,6 +39,7 @@ #include #include #include +#include #include static __inline void @@ -60,6 +61,9 @@ { u_char j; int i, k; + + if (keylen <= 0) + return; /* Initialize state with identity permutation */ for (i = 0; i < 256; i++)