Bug 20410

Summary: NPE in org.apache.poi.hdf.extractor.Utils.convertBytesToShort
Product: POI Reporter: Mario Ivankovits <mario>
Component: HDFAssignee: POI Developers List <dev>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 2.0-dev   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Mario Ivankovits 2003-06-02 09:59:41 UTC
Version: poi-src-2.0-pre1-20030517

When it comes to Utils.convertBytesToShort in 
org.apache.poi.hdf.extractor.StyleSheet.doCHPOperation, a NPE might be thrown 
in line 83 of Utils.


This happens, if varParam in "case 0x9" of doCHPOperation is null.

If i change this case 0x9 to

case 0x9:
    newCHP._fSpec = true;
    if (varParam == null)
    {
        newCHP._ftcSym = -1;
        newCHP._xchSym = -1;
    }
    else
    {
        newCHP._ftcSym = (short)Utils.convertBytesToShort(varParam, 0);
        newCHP._xchSym = (short)Utils.convertBytesToShort(varParam, 2);
    }
    break;

the document is parsed correctly, but i do not know, what side effects this 
could have
Comment 1 Andy Oliver 2003-07-24 16:48:37 UTC
Move dev to HWPF
Comment 2 Mario Ivankovits 2003-07-25 14:19:49 UTC
What do you mean by this??
Comment 3 Andy Oliver 2003-07-25 14:32:15 UTC
HDF is deprecated.  There is a new codebase org.apache.poi.hwpf which will replace it.  Since Ryan 
is totally focused on HWPF, we have guys from IBM working on HWPF, no one is working on HDF, 
I'm just being honest...we're not going to do anything much on HWPF.  We do appreciate your 
contribution because it will help us write HWPF but at this point...go look at org.apache.poi.hwpf.  
More or less HDF stands as it is.