trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [1/2] incubator-trafodion git commit: [TRAFODION-2170] certain create table DDL will fail with core dump
Date Wed, 16 Nov 2016 16:03:27 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 80e721270 -> 11349fa1e


[TRAFODION-2170] certain create table DDL will fail with core dump


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/25fb23e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/25fb23e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/25fb23e5

Branch: refs/heads/master
Commit: 25fb23e522c1c1a643ea2b7045dffe8ca548dc4c
Parents: 34772bc
Author: Liu Ming <ming.liu@esgyn.cn>
Authored: Tue Nov 15 02:30:14 2016 +0000
Committer: Liu Ming <ming.liu@esgyn.cn>
Committed: Tue Nov 15 02:30:14 2016 +0000

----------------------------------------------------------------------
 core/sqf/src/tm/tmddlrequests.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/25fb23e5/core/sqf/src/tm/tmddlrequests.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmddlrequests.cpp b/core/sqf/src/tm/tmddlrequests.cpp
index 28f3b6d..5010407 100644
--- a/core/sqf/src/tm/tmddlrequests.cpp
+++ b/core/sqf/src/tm/tmddlrequests.cpp
@@ -40,7 +40,7 @@ JNIEXPORT jint JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
    char la_tbldesc[TM_MAX_DDLREQUEST_STRING];
    char la_tblname[TM_MAX_DDLREQUEST_STRING];
    char* str_key;
-   str_key = new char[TM_MAX_DDLREQUEST_STRING];
+   str_key = new char[pv_keyLength];
    char** la_keys;
    la_keys = new char *[TM_MAX_DDLREQUEST_STRING];
    int lv_error = FEOK;
@@ -51,9 +51,9 @@ JNIEXPORT jint JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
    }
    else {
       int lv_tbldesc_length = pp_env->GetArrayLength(pv_tableDescriptor);
-      memset(la_tbldesc, 0, lv_tbldesc_length);
+      memset(la_tbldesc, 0, lv_tbldesc_length < TM_MAX_DDLREQUEST_STRING ? lv_tbldesc_length
: TM_MAX_DDLREQUEST_STRING );
       jbyte *lp_tbldesc = pp_env->GetByteArrayElements(pv_tableDescriptor, 0);
-      memcpy(la_tbldesc, lp_tbldesc, lv_tbldesc_length);
+      memcpy(la_tbldesc, lp_tbldesc, lv_tbldesc_length < TM_MAX_DDLREQUEST_STRING ? lv_tbldesc_length
: TM_MAX_DDLREQUEST_STRING -1);
 
       memset(la_tblname, 0, lv_tblname_len < TM_MAX_DDLREQUEST_STRING ? lv_tblname_len
: TM_MAX_DDLREQUEST_STRING);
       jbyte *lp_tblname = pp_env->GetByteArrayElements(pv_tblname, 0);
@@ -82,6 +82,8 @@ JNIEXPORT jint JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMInter
       pp_env->ReleaseByteArrayElements(pv_tableDescriptor, lp_tbldesc, 0);
       pp_env->ReleaseByteArrayElements(pv_tblname, lp_tblname, 0);
    }
+   delete  [] la_keys;
+   delete str_key;
    return lv_error;
 }
 


Mime
View raw message