You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Eduardo Aguinaga (JIRA)" <ji...@apache.org> on 2015/12/15 19:00:49 UTC

[jira] [Created] (KARAF-4216) Poor Error Handling: Return Inside Finally

Eduardo Aguinaga created KARAF-4216:
---------------------------------------

             Summary: Poor Error Handling: Return Inside Finally
                 Key: KARAF-4216
                 URL: https://issues.apache.org/jira/browse/KARAF-4216
             Project: Karaf
          Issue Type: Bug
    Affects Versions: 4.0.3
            Reporter: Eduardo Aguinaga


HP Fortify SCA and SciTools Understand were used to perform an application security analysis on the karaf source code.

The method build() in PublickeyBackingEngineFactory.java returns from inside a finally block on line 52, which will cause exceptions to be lost.

File: jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngineFactory.java
Line: 52

PublickeyBackingEngineFactory.java, lines 40-54:
40 public BackingEngine build(Map options) {
41     PublickeyBackingEngine engine = null;
42     String usersFile = (String) options.get(USER_FILE);
43 
44     File f = new File(usersFile);
45     Properties users;
46     try {
47         users = new Properties(f);
48         engine = new PublickeyBackingEngine(users);
49     } catch (IOException ioe) {
50         logger.warn("Cannot open keys file:" + usersFile);
51     } finally {
52         return engine;
53     }
54 }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)