Skip to content

Commit

Permalink
fixed buffer underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Mar 2, 2014
1 parent 1fa421e commit 9331191
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -46,7 +46,9 @@ public CipherInputStream(


this.bufferedBlockCipher = cipher; this.bufferedBlockCipher = cipher;


buf = new byte[cipher.getOutputSize(INPUT_BUF_SIZE)]; int outSize = cipher.getOutputSize(INPUT_BUF_SIZE);

buf = new byte[(outSize > INPUT_BUF_SIZE) ? outSize : INPUT_BUF_SIZE];
inBuf = new byte[INPUT_BUF_SIZE]; inBuf = new byte[INPUT_BUF_SIZE];
} }


Expand All @@ -71,7 +73,9 @@ public CipherInputStream(InputStream is, AEADBlockCipher cipher)


this.aeadBlockCipher = cipher; this.aeadBlockCipher = cipher;


buf = new byte[cipher.getOutputSize(INPUT_BUF_SIZE)]; int outSize = cipher.getOutputSize(INPUT_BUF_SIZE);

buf = new byte[(outSize > INPUT_BUF_SIZE) ? outSize : INPUT_BUF_SIZE];
inBuf = new byte[INPUT_BUF_SIZE]; inBuf = new byte[INPUT_BUF_SIZE];
} }


Expand Down

0 comments on commit 9331191

Please sign in to comment.