← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16534: DebugUtils, fixed nullpointer vulnerability

 

------------------------------------------------------------
revno: 16534
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-08-27 12:35:22 +0200
message:
  DebugUtils, fixed nullpointer vulnerability
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DebugUtils.java


--
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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DebugUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DebugUtils.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DebugUtils.java	2014-08-27 10:35:22 +0000
@@ -137,10 +137,14 @@
     public static String getStackTrace( Throwable t )
     {
         StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter( sw, true );
-        t.printStackTrace( pw );
-        pw.flush();
-        sw.flush();
+        
+        if ( t != null )
+        {
+            PrintWriter pw = new PrintWriter( sw, true );
+            t.printStackTrace( pw );
+            pw.flush();
+            sw.flush();
+        }
         
         return sw.toString();
     }