mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge pull request #5752 from APriestman/6208_cookieNPE
6208 Fix NPE when cookie file page size is zero
This commit is contained in:
commit
3f51a4c68b
@ -89,7 +89,7 @@ final class BinaryCookieReader implements Iterable<Cookie> {
|
|||||||
throw new IOException(cookieFile.getName() + " is not a cookie file"); //NON-NLS
|
throw new IOException(cookieFile.getName() + " is not a cookie file"); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] sizeArray = null;
|
int[] sizeArray;
|
||||||
int pageCount = dataStream.readInt();
|
int pageCount = dataStream.readInt();
|
||||||
if (pageCount != 0) {
|
if (pageCount != 0) {
|
||||||
sizeArray = new int[pageCount];
|
sizeArray = new int[pageCount];
|
||||||
@ -97,8 +97,9 @@ final class BinaryCookieReader implements Iterable<Cookie> {
|
|||||||
for (int cnt = 0; cnt < pageCount; cnt++) {
|
for (int cnt = 0; cnt < pageCount; cnt++) {
|
||||||
sizeArray[cnt] = dataStream.readInt();
|
sizeArray[cnt] = dataStream.readInt();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
LOG.log(Level.INFO, "No cookies found in {0}", cookieFile.getName()); //NON-NLS
|
LOG.log(Level.INFO, "No cookies found in {0}", cookieFile.getName()); //NON-NLS
|
||||||
|
sizeArray = new int[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
reader = new BinaryCookieReader(cookieFile, sizeArray);
|
reader = new BinaryCookieReader(cookieFile, sizeArray);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user