From 88086dbd9002123be39d00c53460f1ec9f2b719a Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 25 Jun 2006 19:23:27 +0200 Subject: Added versioning information to the XML-file (convenient for later format changes), got rid of confusing "Password successfully changed" message when the user uses the identify-command and protected rc4_decode() against short inputs. --- lib/rc4.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/rc4.c b/lib/rc4.c index 2b732ba2..cbe0e2c0 100644 --- a/lib/rc4.c +++ b/lib/rc4.c @@ -157,6 +157,12 @@ int rc4_decode( unsigned char *crypt, int crypt_len, unsigned char **clear, char key_len = strlen( password ) + RC4_IV_LEN; clear_len = crypt_len - RC4_IV_LEN; + if( clear_len < 0 ) + { + *clear = g_strdup( "" ); + return 0; + } + /* Prepare buffers and the key + IV */ *clear = g_malloc( clear_len + 1 ); key = g_malloc( key_len ); -- cgit v1.2.3