You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2018/01/22 15:53:29 UTC
[2/4] trafodion git commit: fix the bufoverrun Critical error checked
by TScanCode
fix the bufoverrun Critical error checked by TScanCode
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/d6573f9c
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/d6573f9c
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/d6573f9c
Branch: refs/heads/master
Commit: d6573f9c0a1ca7a7f63f76a629e64750a37f038c
Parents: 0166c96
Author: Kenny <xi...@esgyn.cn>
Authored: Fri Jan 12 01:37:08 2018 +0000
Committer: Kenny <xi...@esgyn.cn>
Committed: Fri Jan 12 01:37:08 2018 +0000
----------------------------------------------------------------------
core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp | 8 ++++----
core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h | 6 +++---
win-odbc64/odbcclient/drvr35/diagfunctions.cpp | 5 +++--
3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafodion/blob/d6573f9c/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp b/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
index f703583..d5de863 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
@@ -233,7 +233,7 @@ int CHbaseTM::initJVM()
JavaMethods_[JM_RQREGINFO ].jm_signature = "()Lorg/trafodion/dtm/HashMapArray;";
char className[]="org/trafodion/dtm/HBaseTxClient";
- return (HBTM_RetCode)JavaObjectInterfaceTM::init(className, javaClass_, (JavaMethodInit*)&JavaMethods_, (int)JM_LAST, false);
+ return (HBTM_RetCode)JavaObjectInterfaceTM::init(className, javaClass_, (JavaMethodInit*)&JavaMethods_, (int)JM_TMLAST, false);
}
//////////////////////////////////////////////
@@ -1173,10 +1173,10 @@ HMN_RetCode HashMapArray::init()
return HMN_OK;
if (JavaMethods_)
- return (HMN_RetCode)JavaObjectInterfaceTM::init(className, javaClass_, JavaMethods_, (int32)JM_LAST, true);
+ return (HMN_RetCode)JavaObjectInterfaceTM::init(className, javaClass_, JavaMethods_, (int32)JM_MAPLAST, true);
else
{
- JavaMethods_ = new JavaMethodInit[JM_LAST];
+ JavaMethods_ = new JavaMethodInit[JM_MAPLAST];
JavaMethods_[JM_CTOR ].jm_name = "<init>";
JavaMethods_[JM_CTOR ].jm_signature = "()V";
@@ -1199,7 +1199,7 @@ HMN_RetCode HashMapArray::init()
JavaMethods_[JM_GET_REGINFO ].jm_name = "getRegionInfo";
JavaMethods_[JM_GET_REGINFO ].jm_signature = "(J)Ljava/lang/String;";
- return (HMN_RetCode)JavaObjectInterfaceTM::init(className, javaClass_, JavaMethods_, (int32)JM_LAST, false);
+ return (HMN_RetCode)JavaObjectInterfaceTM::init(className, javaClass_, JavaMethods_, (int32)JM_MAPLAST, false);
}
}
http://git-wip-us.apache.org/repos/asf/trafodion/blob/d6573f9c/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h b/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h
index fb482a9..d8eb6c0 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h
@@ -76,7 +76,7 @@ private:
JM_GET_HOSTNAME,
JM_GET_PORT,
JM_GET_REGINFO,
- JM_LAST
+ JM_MAPLAST
};
static JavaMethodInit* JavaMethods_;
static jclass javaClass_;
@@ -139,9 +139,9 @@ private:
JM_REGTRUNCABORT,
JM_DROPTABLE,
JM_RQREGINFO,
- JM_LAST
+ JM_TMLAST
};
- JavaMethodInit JavaMethods_[JM_LAST];
+ JavaMethodInit JavaMethods_[JM_TMLAST];
static jclass javaClass_;
public:
http://git-wip-us.apache.org/repos/asf/trafodion/blob/d6573f9c/win-odbc64/odbcclient/drvr35/diagfunctions.cpp
----------------------------------------------------------------------
diff --git a/win-odbc64/odbcclient/drvr35/diagfunctions.cpp b/win-odbc64/odbcclient/drvr35/diagfunctions.cpp
index e9633b9..3a6ff2c 100644
--- a/win-odbc64/odbcclient/drvr35/diagfunctions.cpp
+++ b/win-odbc64/odbcclient/drvr35/diagfunctions.cpp
@@ -123,10 +123,11 @@ char *TraceOptionToString(long TraceOption)
long index;
if (TraceOption == 0)
- index = sizeof(TraceOptionString) - 1;
+ index = sizeof(TraceOptionString)/sizeof(TraceOptionString[0]) - 1;
else
for (index = 0;
- (TraceOption & 1) == 0 && index < sizeof(TraceOptionString);
+ (TraceOption & 1) == 0 &&
+ index < sizeof(TraceOptionString)/sizeof(TraceOptionString[0]);
TraceOption >>= 1, index++);
return TraceOptionString[index];
}