dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11706
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3412: Fixed nullpointer vulnerability in completeness report
------------------------------------------------------------
revno: 3412
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-04-15 16:37:44 +0200
message:
Fixed nullpointer vulnerability in completeness report
modified:
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java 2011-03-29 11:00:48 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java 2011-04-15 14:37:44 +0000
@@ -158,12 +158,17 @@
return type;
}
else
- {
- Integer _periodId = periodService.getPeriodByExternalId( periodId ).getId();
+ {
OrganisationUnit selectedUnit = selectionTreeManager.getSelectedOrganisationUnit();
- if ( periodId != null && selectedUnit != null && criteria != null )
- {
+ if ( periodId == null || selectedUnit == null || criteria == null )
+ {
+ return INPUT;
+ }
+ else
+ {
+ Integer _periodId = periodService.getPeriodByExternalId( periodId ).getId();
+
DataSet dataSet = null;
List<DataSetCompletenessResult> results = null;
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-04-07 13:48:56 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml 2011-04-15 14:37:44 +0000
@@ -259,6 +259,7 @@
</action>
<action name="getDataCompleteness" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessAction">
+ <result name="input" type="redirect">displayViewDataCompletenessForm.action</result>
<result name="csv" type="gridCsvResult"/>
<result name="xls" type="gridXlsResult"/>
<result name="pdf" type="gridPdfResult"/>