Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-24 15:20:35 +01:00
Make sure in-place AES respects reader index
Dieser Commit ist enthalten in:
Ursprung
d73496e8df
Commit
af0903050d
@ -40,10 +40,10 @@ public class JavaVelocityCipher implements VelocityCipher {
|
||||
Preconditions.checkArgument(source.hasArray(), "No source array");
|
||||
|
||||
int inBytes = source.readableBytes();
|
||||
int baseOffset = source.arrayOffset() + source.readerIndex();
|
||||
|
||||
try {
|
||||
cipher.update(source.array(), source.arrayOffset(), inBytes, source.array(),
|
||||
source.arrayOffset());
|
||||
cipher.update(source.array(), baseOffset, inBytes, source.array(), baseOffset);
|
||||
} catch (ShortBufferException ex) {
|
||||
/* This _really_ shouldn't happen - AES CFB8 will work in place.
|
||||
If you run into this, that means that for whatever reason the Java Runtime has determined
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren