dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16241
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6133: Fixed NPE vulnerability
------------------------------------------------------------
revno: 6133
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-02-28 18:36:14 +0100
message:
Fixed NPE vulnerability
modified:
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/ContextUtils.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-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/ContextUtils.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/ContextUtils.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/ContextUtils.java 2012-02-28 17:36:14 +0000
@@ -141,14 +141,17 @@
{
Cookie[] cookies = request.getCookies();
- for ( Cookie c : cookies )
+ if ( cookies != null )
{
- if ( c.getName().equalsIgnoreCase( cookieName ) )
+ for ( Cookie c : cookies )
{
- return c.getValue();
+ if ( c.getName().equalsIgnoreCase( cookieName ) )
+ {
+ return c.getValue();
+ }
}
}
-
+
return null;
}