horwat      2002/08/29 16:56:12

  Modified:    catalina/src/share/org/apache/catalina/util
                        ExtensionValidator.java
  Log:
  Add more robust handling of invalid manifests.
  
  If a manifest does not end with a newline as defined by the Manifest Specification 
(http://java.sun.com/j2se/1.4/docs/guide/jar/jar.html#JAR%20Manifest) then 
JarInputStream.getManifest() returns a null value.
  
  Revision  Changes    Path
  1.2       +10 -8     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java
  
  Index: ExtensionValidator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/ExtensionValidator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExtensionValidator.java   24 Aug 2002 02:27:28 -0000      1.1
  +++ ExtensionValidator.java   29 Aug 2002 23:56:12 -0000      1.2
  @@ -237,10 +237,12 @@
                               InputStream in = resource.streamContent();
                               JarInputStream jin = new JarInputStream(in);
                               Manifest jmanifest = jin.getManifest();
  -                            ManifestResource mre = new ManifestResource
  -                                (binding.getName(), jmanifest, 
  -                                ManifestResource.APPLICATION);
  -                            appManifestResources.add(mre);
  +                            if (jmanifest != null) {
  +                                ManifestResource mre = new ManifestResource
  +                                    (binding.getName(), jmanifest, 
  +                                    ManifestResource.APPLICATION);
  +                                appManifestResources.add(mre);
  +                            }
                           } catch (java.io.IOException iox) {
                               // do not do anything... go to the next entry
                           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to