wieseljonas / java-libpst

Automatically exported from code.google.com/p/java-libpst
1 stars 1 forks source link

java.lang.NullPointerException at com.pff.PSTFile.processNameToIdMap(PSTFile.java:125) #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In Java program at initial step
    pstFile = new PSTFile("test2.pst");
   (the test2.pst file is attached)

2. It immediately creates the error:
java.lang.NullPointerException at 
com.pff.PSTFile.processNameToIdMap(PSTFile.java:125)

What is the expected output? What do you see instead?

I expected to get 2 email counts after using the follwoing statements:

PSTFolder pstFolder = pstFile.getRootFolder();
int emailnum = pstFolder.getEmailCount();

But it has initial PSTFile object creation problem from this test2.pst file

What version of the product are you using? On what operating system?
I tried both 0.3 and 0.2 versions of java-libpst on Windows XP

Please provide any additional information below.

Thanks for any advice.

Original issue reported on code.google.com by pliu...@gmail.com on 23 Jun 2010 at 10:02

Attachments:

GoogleCodeExporter commented 9 years ago
test2.pst file is based on  compressible encryption.  The attached test3.pst is 
based  on unencripted. 

Both have a problem in  method processNameToIdMap, and stop at statement 
  nameToIdByte = mapEntries.data  in PSTFile.java

Original comment by pliu...@gmail.com on 24 Jun 2010 at 2:49

Attachments:

GoogleCodeExporter commented 9 years ago
Sweet, thanks for the bug report.

It also gave me a chance to look up the microsoft published specs.

So, the problem was when I was reading in the indexes that described the 
boundaries of items in a table I was actually reading in the start value of 0 
as well.  This was fine on every PST I tested with 'cause the preceding two 
bytes happened to always be 0, but in your case there was actually some data 
there.  It turns out that the starting index of 0 is assumed in the docs, so I 
just hard-coded that in and it seems to work.

There's a new release there for you, grab it and give it a bash!

Thanks,

Richard

Original comment by rjohnson...@gmail.com on 24 Jun 2010 at 6:11