bugMibble MIB Parser - Bugs: bug #18843, NPE when parsing unresolved...

 
 

bug #18843: NPE when parsing unresolved SEQUENCE types

Submitter:  Per Cederberg <cederberg>
Submitted:  Sun 21 Jan 2007 10:48:31 AM UTC
   
 
Severity:  5 - Major Item Group:  Software
Status:  Fixed Privacy:  Public
Assigned to:  cederberg Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 04 Apr 2009 09:08:56 AM UTC, comment #2: 

Version 2.9 was released on 2009-03-19.

Per Cederberg <cederberg>
Group administrator
Sun 21 Jan 2007 11:08:56 AM UTC, comment #1: 

Ok, after further analysis the real cause for the error must be considered to exist in the TypeReference class. This minor patch to the TypeReference.initialize() method fixes the issue:

         sym = getSymbol(log);
         if (sym instanceof MibTypeSymbol) {
             type = initializeReference(symbol, log, (MibTypeSymbol) sym);
+            if (type == null) {
+                message = "referenced symbol '" + sym.getName() +
+                          "' contains undefined type";
+                throw new MibException(location, message);
+            }
             return type;

The fix will be present in version 2.9.alpha1 (coming monday) and later.

Per Cederberg <cederberg>
Group administrator
Sun 21 Jan 2007 10:48:31 AM UTC, original submission:  

When parsing a SEQUENCE type that contains unresolved symbols, a NullPointerException is thrown:

java.lang.NullPointerException
        at net.percederberg.mibble.type.ElementType.initialize(ElementType.java:86)
        at net.percederberg.mibble.type.SequenceType.initialize(SequenceType.java:96)
        at net.percederberg.mibble.type.TypeReference.initializeReference(TypeReference.java:216)
        at net.percederberg.mibble.type.TypeReference.initialize(TypeReference.java:169)
        at net.percederberg.mibble.snmp.SnmpObjectType.initialize(SnmpObjectType.java:186)
        at net.percederberg.mibble.MibValueSymbol.initialize(MibValueSymbol.java:94)
        at net.percederberg.mibble.Mib.validate(Mib.java:187)
        at net.percederberg.mibble.MibLoader.loadQueue(MibLoader.java:624)
        at net.percederberg.mibble.MibLoader.load(MibLoader.java:448)
        at net.percederberg.mibble.MibLoader.load(MibLoader.java:377)
 
It seems the cause is some unsafe initialization code inside the ElementType (which is called twice, due to symbol references).

This issue was reported by Markus Barchfeld.

Per Cederberg <cederberg>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cederberg (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-04-04 cederberg Open/ClosedOpen Closed
    2007-01-21 cederberg StatusNone Fixed
    2007-01-21 cederberg Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code