hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077473 - /hadoop/common/branches/branch-0.20-security-patches/src/webapps/hdfs/dfsnodelist.jsp
Date Fri, 04 Mar 2011 04:18:39 GMT
Author: omalley
Date: Fri Mar  4 04:18:39 2011
New Revision: 1077473

URL: http://svn.apache.org/viewvc?rev=1077473&view=rev
Log:
commit 6f7f85c78d4331e61677d182359ee251be3b2c58
Author: Ravi Phulari <rphulari@yahoo-inc.com>
Date:   Tue May 18 10:13:00 2010 -0700

    HDFS-1153 from https://issues.apache.org/jira/secure/attachment/12444458/HDFS-1153.patch
    
    +++ b/YAHOO-CHANGES.txt
    +    HDFS-1153. The navigation to /dfsnodelist.jsp with invalid input
    +    parameters produces NPE and HTTP 500 error (rphulari)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/webapps/hdfs/dfsnodelist.jsp

Modified: hadoop/common/branches/branch-0.20-security-patches/src/webapps/hdfs/dfsnodelist.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/webapps/hdfs/dfsnodelist.jsp?rev=1077473&r1=1077472&r2=1077473&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/webapps/hdfs/dfsnodelist.jsp (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/webapps/hdfs/dfsnodelist.jsp Fri
Mar  4 04:18:39 2011
@@ -168,7 +168,13 @@ throws IOException {
 	ArrayList<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>();
 	jspHelper.DFSNodesStatus(live, dead);
 
-	whatNodes = request.getParameter("whatNodes"); // show only live or only dead nodes
+       //verify input for correctness 
+       String whatNodes = request.getParameter("whatNodes");// show only live or only dead
nodes
+       if (whatNodes == null || whatNodes.length() == 0) {
+         out.print("Invalid input");
+         return;
+       }
+
 	sorterField = request.getParameter("sorter/field");
 	sorterOrder = request.getParameter("sorter/order");
 	if ( sorterField == null )
@@ -293,6 +299,9 @@ throws IOException {
                           out.print("</table>\n");
                         }
                         out.print("</div>");
+                  } else {
+                    // if nothing matches then print invalid input
+                    out.println("Invalid input");
                   }
 	}
 }%>



Mime
View raw message