Hello,

I am proposing a patch which includes NULL checks for setMaxFlex() and setMaxMembers() in ChannelOverview.java.

Without that, in few cases where maxFlex or maxMembers were null, it led to NullPointerException and page https://server.example.com/rhn/admin/multiorg/OrgSoftwareSubscriptions.do?oid=<orgid> failed with an ISE.

We already have a bugzilla created for RHN Satellite v5.4 - https://bugzilla.redhat.com/show_bug.cgi?id=671450

Regards,
Paresh
>From 0bbf4b16fb3b439acc8a761535182a96df63e9e6 Mon Sep 17 00:00:00 2001
From: Paresh Mutha <pmu...@redhat.com>
Date: Thu, 27 Jan 2011 10:01:19 +0530
Subject: [PATCH] Added NULL checks in setMaxFlex() and setMaxMembers()
 Signed-off-by: Paresh Mutha <pmu...@redhat.com>

---
 .../redhat/rhn/frontend/dto/ChannelOverview.java   |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/frontend/dto/ChannelOverview.java 
b/java/code/src/com/redhat/rhn/frontend/dto/ChannelOverview.java
index 0eb5ae0..ba623fb 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/ChannelOverview.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/ChannelOverview.java
@@ -90,7 +90,12 @@ public class ChannelOverview extends BaseDto implements 
Comparable {
      * @param maxFlexIn The maxFlex to set.
      */
     public void setMaxFlex(Long maxFlexIn) {
-        this.maxFlex = maxFlexIn;
+        if(maxFlexIn == null){
+                this.maxFlex = new Long(0L);
+        }
+        else{
+                this.maxFlex = maxFlexIn;
+        }
     }
 
     /**
@@ -224,7 +229,12 @@ public class ChannelOverview extends BaseDto implements 
Comparable {
      * @param maxMembersIn The maxMembers to set.
      */
     public void setMaxMembers(Long maxMembersIn) {
-        this.maxMembers = maxMembersIn;
+        if(maxMembersIn == null){
+                this.maxMembers = new Long(0L);
+        }
+        else{
+                this.maxMembers = maxMembersIn;
+        }
     }
 
     /**
-- 
1.7.2.3

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to