Repository: carbondata
Updated Branches:
  refs/heads/master 3b8de320d -> 32eb0a1c3


[HOTFIX] Intializing the CSDK object reference to NULL

NULL intialization done to JObjects in CPP files of CSDK. This prevents seg 
fault when these objects are referenced without initilization.

This closes #2935


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/32eb0a1c
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/32eb0a1c
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/32eb0a1c

Branch: refs/heads/master
Commit: 32eb0a1c3dc2df4caa61f09e128ae78023074da1
Parents: 3b8de32
Author: brijoobopanna <[email protected]>
Authored: Tue Nov 20 18:59:54 2018 +0530
Committer: kunal642 <[email protected]>
Committed: Wed Nov 21 16:25:07 2018 +0530

----------------------------------------------------------------------
 store/CSDK/src/CarbonProperties.h   |  6 +++---
 store/CSDK/src/CarbonReader.h       |  6 +++---
 store/CSDK/src/CarbonRow.h          | 24 ++++++++++++------------
 store/CSDK/src/CarbonSchemaReader.h |  4 ++--
 store/CSDK/src/CarbonWriter.h       |  6 +++---
 store/CSDK/src/Schema.h             |  6 +++---
 6 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/32eb0a1c/store/CSDK/src/CarbonProperties.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonProperties.h 
b/store/CSDK/src/CarbonProperties.h
index a5d391b..39fbbda 100644
--- a/store/CSDK/src/CarbonProperties.h
+++ b/store/CSDK/src/CarbonProperties.h
@@ -22,17 +22,17 @@ private:
     /**
      * carbonProperties Class
      */
-    jclass carbonPropertiesClass;
+    jclass carbonPropertiesClass = NULL;
 
     /**
      * carbonProperties Object
      */
-    jobject carbonPropertiesObject;
+    jobject carbonPropertiesObject = NULL;
 public:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * Constructor of CarbonProperties

http://git-wip-us.apache.org/repos/asf/carbondata/blob/32eb0a1c/store/CSDK/src/CarbonReader.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonReader.h b/store/CSDK/src/CarbonReader.h
index 20c90bf..246e24b 100644
--- a/store/CSDK/src/CarbonReader.h
+++ b/store/CSDK/src/CarbonReader.h
@@ -38,12 +38,12 @@ private:
      * carbonReaderBuilder object for building carbonReader
      * it can configure some operation
      */
-    jobject carbonReaderBuilderObject;
+    jobject carbonReaderBuilderObject = NULL;
 
     /**
      * carbonReader object for reading data
      */
-    jobject carbonReaderObject;
+    jobject carbonReaderObject = NULL;
 
     /**
      * Return true if carbonReaderBuilder Object isn't NULL
@@ -65,7 +65,7 @@ public:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * create a CarbonReaderBuilder object for building carbonReader,

http://git-wip-us.apache.org/repos/asf/carbondata/blob/32eb0a1c/store/CSDK/src/CarbonRow.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonRow.h b/store/CSDK/src/CarbonRow.h
index 3dae5d3..c57f826 100644
--- a/store/CSDK/src/CarbonRow.h
+++ b/store/CSDK/src/CarbonRow.h
@@ -19,21 +19,21 @@
 
 class CarbonRow {
 private:
-    jmethodID getShortId;
-    jmethodID getIntId;
-    jmethodID getLongId;
-    jmethodID getDoubleId;
-    jmethodID getFloatId;
-    jmethodID getBooleanId;
-    jmethodID getStringId;
-    jmethodID getDecimalId;
-    jmethodID getVarcharId;
-    jmethodID getArrayId;
+    jmethodID getShortId = NULL;
+    jmethodID getIntId = NULL;
+    jmethodID getLongId = NULL;
+    jmethodID getDoubleId = NULL;
+    jmethodID getFloatId = NULL;
+    jmethodID getBooleanId = NULL;
+    jmethodID getStringId = NULL;
+    jmethodID getDecimalId = NULL;
+    jmethodID getVarcharId = NULL;
+    jmethodID getArrayId = NULL;
 
     /**
      * RowUtil Class for read data from Carbon Row
      */
-    jclass rowUtilClass;
+    jclass rowUtilClass = NULL;
 
     /**
      * carbon row data
@@ -57,7 +57,7 @@ public:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * Constructor and express the carbon row result

http://git-wip-us.apache.org/repos/asf/carbondata/blob/32eb0a1c/store/CSDK/src/CarbonSchemaReader.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonSchemaReader.h 
b/store/CSDK/src/CarbonSchemaReader.h
index 5c1b324..2746773 100644
--- a/store/CSDK/src/CarbonSchemaReader.h
+++ b/store/CSDK/src/CarbonSchemaReader.h
@@ -23,12 +23,12 @@ private:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * carbonSchemaReader Class for get method id and call method
      */
-    jclass carbonSchemaReaderClass;
+    jclass carbonSchemaReaderClass = NULL;
 
 public:
 

http://git-wip-us.apache.org/repos/asf/carbondata/blob/32eb0a1c/store/CSDK/src/CarbonWriter.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonWriter.h b/store/CSDK/src/CarbonWriter.h
index 2c8c715..a822432 100644
--- a/store/CSDK/src/CarbonWriter.h
+++ b/store/CSDK/src/CarbonWriter.h
@@ -22,7 +22,7 @@ private:
     /**
     * jni env
     */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * carbonWriterBuilder object for building carbonWriter
@@ -33,12 +33,12 @@ private:
     /**
      * carbonWriter object for writing data
      */
-    jobject carbonWriterObject;
+    jobject carbonWriterObject = NULL;
 
     /**
      * carbon writer class
      */
-    jclass carbonWriter;
+    jclass carbonWriter = NULL;
 
     /**
      * write method id

http://git-wip-us.apache.org/repos/asf/carbondata/blob/32eb0a1c/store/CSDK/src/Schema.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/Schema.h b/store/CSDK/src/Schema.h
index e9ddf4e..67434ef 100644
--- a/store/CSDK/src/Schema.h
+++ b/store/CSDK/src/Schema.h
@@ -28,17 +28,17 @@ private:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * schema class for get method id
      */
-    jclass schemaClass;
+    jclass schemaClass = NULL;
 
     /**
      * carbon schema data
      */
-    jobject schema;
+    jobject schema = NULL;
 
     /**
      * check ordinal, ordinal can't be negative

Reply via email to