Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2318

Possible NPE for jars with null Manifest

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • fileinstall-3.1.0
    • File Install
    • None

    Description

      JarFile.getManifest() can return null, so caller must check return value for null-ness to avoid NPE. I see two such occurrences in fileinstall:

      DirectoryWatcher.java:
      private Bundle installOrUpdateBundle(
      String bundleLocation, BufferedInputStream is, long checksum)
      throws IOException, BundleException
      {
      is.mark(256 * 1024);
      JarInputStream jar = new JarInputStream(is);
      Manifest m = jar.getManifest();
      String sn = m.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME);
      ...

      BundleTransformer.java:
      Manifest m = jar.getManifest();
      if (m.getMainAttributes().getValue(new Attributes.Name("Bundle-SymbolicName")) != null)
      ...

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            sahoo Sanjeeb Kumar Sahoo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: