Fix sequence point issue in arcfour (S[x] = --x; is undefined).
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@228 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -93,7 +93,7 @@ static inline void arcfourInit(arckey *arc, char *userkey, unsigned short len)
|
||||
|
||||
/* Seed the S-box linearly, then mix in the key while stiring briskly */
|
||||
arc->i = arc->j = 0; /* Initialize i and j to 0 */
|
||||
while((S[x] = --x)); /* Initialize S-box, backwards */
|
||||
while(--x, (S[x] = x)); /* Initialize S-box, backwards */
|
||||
|
||||
/* Note: Some of these optimizations REQUIRE arcword to be 8-bit unsigned */
|
||||
do { /* Spread user key into real key */
|
||||
|
||||
Reference in New Issue
Block a user