Browse Source

fix index out of range

tags/2.3
clowwindy 10 years ago
parent
commit
1defa4a59a
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      shadowsocks-csharp/Encrypt/OpenSSLEncryptor.cs
  2. +1
    -1
      shadowsocks-csharp/Encrypt/PolarSSLEncryptor.cs

+ 1
- 1
shadowsocks-csharp/Encrypt/OpenSSLEncryptor.cs View File

@@ -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
{


+ 1
- 1
shadowsocks-csharp/Encrypt/PolarSSLEncryptor.cs View File

@@ -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);
}
}
}


Loading…
Cancel
Save