[
https://issues.apache.org/jira/browse/TRAFODION-2386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15727162#comment-15727162
]
ASF GitHub Bot commented on TRAFODION-2386:
-------------------------------------------
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/868#discussion_r91201853
--- Diff: dcs/src/test/odbc/src/common/Global.cpp ---
@@ -0,0 +1,116 @@
+/*************************************************************************
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+**************************************************************************/
+
+#include "Global.h"
+
+char *rTrim(char *string)
+{
+ char *strPtr;
+
+ for (strPtr = string + strlen(string) - 1;
+ strPtr >= string && (*strPtr == ' ' || *strPtr == '\t');
+ *(strPtr--) = '\0');
+ return(string);
+}
+
+int ConvertCharToCNumeric(SQL_NUMERIC_STRUCT& numericTmp, CHAR* cTmpBuf)
+{
+ unsigned char localBuf[101];
+ char* tempPtr = (char*)localBuf, *tempPtr1;
+ int i, j, a, b, current, calc, length;
+
+ SQLCHAR tempPrecision;
+ SQLCHAR tempScale;
+ SQLCHAR tempSign;
+ SQLCHAR tmpVal[101];
+
+ if (strlen(rTrim(cTmpBuf)) > sizeof(tmpVal))
--- End diff --
What happens if strlen(rTrim(cTmpBuf)) == sizeof(tmpVal)? Won't you get a
buffer overrun at line 52 because there isn't room for the null terminator?
> Need to add odbc unit-test code for large varchar column issue
> --------------------------------------------------------------
>
> Key: TRAFODION-2386
> URL: https://issues.apache.org/jira/browse/TRAFODION-2386
> Project: Apache Trafodion
> Issue Type: Sub-task
> Components: client-odbc-linux, client-odbc-windows
> Reporter: Zhang,Xiang
> Assignee: Zhang,Xiang
>
> Need to add odbc unit-test code to trafodion repo
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)