directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-commander git commit: FC-105 - [fortress-web] - possible null dereference
Date Thu, 21 May 2015 12:50:01 GMT
Repository: directory-fortress-commander
Updated Branches:
  refs/heads/master 4d75e768f -> 18fcf2c17


FC-105 - [fortress-web] - possible null dereference


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/commit/18fcf2c1
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/tree/18fcf2c1
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/diff/18fcf2c1

Branch: refs/heads/master
Commit: 18fcf2c170ada3d3cf10e68925ff11fb9434e917
Parents: 4d75e76
Author: Shawn McKinney <smckinney@apache.org>
Authored: Thu May 21 07:49:53 2015 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Thu May 21 07:49:53 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/directory/fortress/web/OUListModel.java  | 7 +++++--
 .../org/apache/directory/fortress/web/PermListModel.java     | 8 ++++++--
 .../java/org/apache/directory/fortress/web/SDListModel.java  | 7 ++++++-
 3 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/18fcf2c1/src/main/java/org/apache/directory/fortress/web/OUListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/OUListModel.java b/src/main/java/org/apache/directory/fortress/web/OUListModel.java
index fe427a5..5bcd754 100644
--- a/src/main/java/org/apache/directory/fortress/web/OUListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/OUListModel.java
@@ -121,10 +121,13 @@ public class OUListModel extends Model<SerializableList<OrgUnit>>
     private List<OrgUnit> getList( OrgUnit orgUnit )
     {
         List<OrgUnit> orgUnitList = null;
-        
+        if( orgUnit == null || orgUnit.getType() == null )
+        {
+            throw new RuntimeException( "Orgunit invalid state" );
+        }
         try
         {
-            String szOrgUnitNm = orgUnit != null && orgUnit.getName() != null ? orgUnit.getName()
: "";
+            String szOrgUnitNm = orgUnit.getName();
             LOG.debug( ".getList orgUnitNm: " + szOrgUnitNm );
             orgUnitList = delReviewMgr.search( orgUnit.getType(), orgUnit.getName() );
             // sort list by name:

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/18fcf2c1/src/main/java/org/apache/directory/fortress/web/PermListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/PermListModel.java b/src/main/java/org/apache/directory/fortress/web/PermListModel.java
index a18d8f4..812395e 100644
--- a/src/main/java/org/apache/directory/fortress/web/PermListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/PermListModel.java
@@ -123,11 +123,15 @@ public class PermListModel extends Model<SerializableList<Permission>>
     private List<Permission> getList( Permission perm )
     {
         List<Permission> permsList = null;
+        if( perm == null )
+        {
+            throw new RuntimeException( "Invalid permission state");
+        }
         
         try
         {
-            String szObjectNm = perm != null ? perm.getObjName() : "";
-            String szOpNm = perm != null ? perm.getOpName() : "";
+            String szObjectNm = perm.getObjName();
+            String szOpNm = perm.getOpName();
             LOG.debug( ".getList objectNm: " + szObjectNm + " opNm: " + szOpNm );
             perm.setAdmin( isAdmin );
             permsList = reviewMgr.findPermissions( perm );

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/18fcf2c1/src/main/java/org/apache/directory/fortress/web/SDListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/SDListModel.java b/src/main/java/org/apache/directory/fortress/web/SDListModel.java
index e3fc4a4..bae021a 100644
--- a/src/main/java/org/apache/directory/fortress/web/SDListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/SDListModel.java
@@ -122,10 +122,15 @@ public class SDListModel extends Model<SerializableList<SDSet>>
     private List<SDSet> getList( SDSet sdSet )
     {
         List<SDSet> sdSetList = null;
+
+        if( sdSet == null )
+        {
+            throw new RuntimeException( "Invalid SDSet State" );
+        }
         
         try
         {
-            String szSdSetNm = sdSet != null && sdSet.getName() != null ? sdSet.getName()
: "";
+            String szSdSetNm = sdSet.getName();
             LOG.debug( ".getList sdSetNm: " + szSdSetNm );
 
             if ( VUtil.isNotNullOrEmpty( sdSet.getMembers() ) )


Mime
View raw message