← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12425: SMS nullpointer vulnerability

 

------------------------------------------------------------
revno: 12425
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-10-04 11:09:45 +0200
message:
  SMS nullpointer vulnerability
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsPublisher.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-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsPublisher.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsPublisher.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/SmsPublisher.java	2013-10-04 09:09:45 +0000
@@ -60,7 +60,11 @@
 
     public void stop()
     {
-        thread.stopFetching();
+        if ( thread != null )
+        {
+            thread.stopFetching();
+        }
+        
         thread = null;
     }
 
@@ -115,7 +119,7 @@
                             return;
                         }
                     }
-                    // No Command found
+                    
                     smsSender.sendMessage( "No command found", message.getOriginator() );
                 }
                 catch ( Exception e )
@@ -124,7 +128,6 @@
                     smsSender.sendMessage( e.getMessage(), message.getOriginator() );
                 }
 
-                // remove for error case
                 messageQueue.remove( message );
                 message = messageQueue.get();
                 log.info( "Queue Size: " + messageQueue.get() );