mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge pull request #1556 from robertolarcher/develop
Email Parser: NegativeArraySizeException patch
This commit is contained in:
commit
350fc355c0
@ -254,10 +254,16 @@ class PstParser {
|
|||||||
int bufferSize = 8176;
|
int bufferSize = 8176;
|
||||||
byte[] buffer = new byte[bufferSize];
|
byte[] buffer = new byte[bufferSize];
|
||||||
int count = attachmentStream.read(buffer);
|
int count = attachmentStream.read(buffer);
|
||||||
|
|
||||||
|
if(count == -1) {
|
||||||
|
throw new IOException("attachmentStream invalid (read() fails). File "+attach.getLongFilename()+ " skipped");
|
||||||
|
}
|
||||||
|
|
||||||
while (count == bufferSize) {
|
while (count == bufferSize) {
|
||||||
out.write(buffer);
|
out.write(buffer);
|
||||||
count = attachmentStream.read(buffer);
|
count = attachmentStream.read(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] endBuffer = new byte[count];
|
byte[] endBuffer = new byte[count];
|
||||||
System.arraycopy(buffer, 0, endBuffer, 0, count);
|
System.arraycopy(buffer, 0, endBuffer, 0, count);
|
||||||
out.write(endBuffer);
|
out.write(endBuffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user