From 16710758f1d82402ce954356231ae35ae15d75f3 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Fri, 10 Oct 2014 23:02:22 -0700 Subject: [PATCH] HADOOP-11193. Fix uninitialized variables in NativeIO.c. Contributed by Xiaoyu Yao. --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c | 2 +- .../hadoop-common/src/main/winutils/libwinutils.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 9230394e0bc..4ad8f669af4 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -483,6 +483,9 @@ Release 2.6.0 - UNRELEASED HADOOP-11133. Should trim the content of keystore password file for JavaKeyStoreProvider (Yi Liu via umamahesh) + HADOOP-11193. Fix uninitialized variables in NativeIO.c + (Xiaoyu Yao via wheat9) + BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS HADOOP-10734. Implement high-performance secure random number sources. diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c index d8538c8b0be..b98aa0c0991 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c @@ -275,7 +275,7 @@ cleanup: #ifdef WINDOWS LPWSTR owner = NULL; LPWSTR group = NULL; - int mode; + int mode = 0; jstring jstr_owner = NULL; jstring jstr_group = NULL; int rc; diff --git a/hadoop-common-project/hadoop-common/src/main/winutils/libwinutils.c b/hadoop-common-project/hadoop-common/src/main/winutils/libwinutils.c index da16ff5b081..f27511173da 100644 --- a/hadoop-common-project/hadoop-common/src/main/winutils/libwinutils.c +++ b/hadoop-common-project/hadoop-common/src/main/winutils/libwinutils.c @@ -807,8 +807,8 @@ DWORD FindFileOwnerAndPermission( DWORD cbSid = SECURITY_MAX_SID_SIZE; PACL pDacl = NULL; - BOOL isSymlink; - BY_HANDLE_FILE_INFORMATION fileInformation; + BOOL isSymlink = FALSE; + BY_HANDLE_FILE_INFORMATION fileInformation = {0}; ACCESS_MASK ownerAccessRights = 0; ACCESS_MASK groupAccessRights = 0;