Bug 20410 - NPE in org.apache.poi.hdf.extractor.Utils.convertBytesToShort
Summary: NPE in org.apache.poi.hdf.extractor.Utils.convertBytesToShort
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: HDF (show other bugs)
Version: 2.0-dev
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-02 09:59 UTC by Mario Ivankovits
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.