Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1553

An incomplete fix for the NPE bugs in XSAttributeUseImpl.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Incomplete
    • None
    • None
    • Other

    Description

      The fix revision 320528 was aimed to remove an NPE bug on the "this.fDefault" and "this.fDefault.actualValue" in the method "getConstraintValue" of the file "/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java" , but it is incomplete.
      Since the "this.fDefault" is a class field and also could be null during the run-time execution, it should also be null-checked before being dereferenced in other methods.

      The buggy code locations the same fix needs to be applied at are as bellows:

      Line 123 of the method "getActualVC";
      public Object getActualVC()

      { return getConstraintType() == XSConstants.VC_NONE ? null : fDefault.actualValue; }

      Line 129 of the method "getActualVCType":

      public short getActualVCType()

      { return getConstraintType() == XSConstants.VC_NONE ? XSConstants.UNAVAILABLE_DT : fDefault.actualValueType; }

      Line 135 of the method "getItemValueTypes" :

      public ShortList getItemValueTypes()

      { return getConstraintType() == XSConstants.VC_NONE ? null : fDefault.itemValueTypes; }

      Attachments

        Activity

          People

            Unassigned Unassigned
            guangtai Guangtai Liang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: