fix index out of range

This commit is contained in:
clowwindy
2014-11-11 21:51:46 +08:00
parent acf2f807a8
commit 1defa4a59a
2 changed files with 2 additions and 2 deletions
@@ -40,7 +40,7 @@ namespace Shadowsocks.Encrypt
outlength = length + ivLen;
OpenSSL.EVP_CipherUpdate(_encryptCtx, tempbuf, out outlength, buf, length);
outlength = length + ivLen;
Buffer.BlockCopy(tempbuf, 0, outbuf, ivLen, outlength);
Buffer.BlockCopy(tempbuf, 0, outbuf, ivLen, length);
}
else
{
@@ -192,7 +192,7 @@ namespace Shadowsocks.Encrypt
break;
}
outlength = length + ivLen;
Buffer.BlockCopy(tempbuf, 0, outbuf, ivLen, outlength);
Buffer.BlockCopy(tempbuf, 0, outbuf, ivLen, length);
}
}
}