ソースを参照

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)
+


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077473 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 年 前
コミット
d99fc6636d
1 ファイル変更10 行追加1 行削除
  1. 10 1
      src/webapps/hdfs/dfsnodelist.jsp

+ 10 - 1
src/webapps/hdfs/dfsnodelist.jsp

@@ -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");
                   }
 	}
 }%>