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

 
 

bug #18843: NPE when parsing unresolved SEQUENCE types

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

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Version 2.9 was released on 2009-03-19.

Per Cederberg <cederberg>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

(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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    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.4