Browse Source

HADOOP-9110. winutils ls off-by-one error indexing MONTHS array can cause access violation. Contributed by Chris Nauroth.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-trunk-win@1416102 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 năm trước cách đây
mục cha
commit
d0cb3689a6

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.branch-trunk-win.txt

@@ -56,3 +56,6 @@ branch-trunk-win changes - unreleased
 
   HADOOP-9011. saveVersion.py does not include branch in version annotation.
   (Chris Nauroth via suresh)
+
+  HADOOP-9110. winutils ls off-by-one error indexing MONTHS array can cause 
+  access violation. (Chris Nauroth via suresh)

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/winutils/ls.c

@@ -119,7 +119,7 @@ static BOOL LsPrintLine(
 
   fwprintf(stdout, L"%10s %d %s %s %lld %3s %2d %4d %s\n",
     maskString, hardlinkCount, ownerName, groupName, fileSize.QuadPart,
-    MONTHS[stFileWriteTime.wMonth], stFileWriteTime.wDay,
+    MONTHS[stFileWriteTime.wMonth-1], stFileWriteTime.wDay,
     stFileWriteTime.wYear, path);
 
   ret = TRUE;