trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xwq <>
Subject [GitHub] incubator-trafodion pull request #1078: [TRAFODION-2602] memory out of bound...
Date Fri, 05 May 2017 01:54:35 GMT
Github user xwq commented on a diff in the pull request:
    --- Diff: core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp ---
    @@ -1555,6 +1555,7 @@ unsigned long ODBC::ConvertSQLToC(SQLINTEGER	ODBCAppVersion,
     								return IDS_22_003;
     							srcLength = TransStringLength + 1;
    +                            DataLen = sizeof(DATE_STRUCT);
    --- End diff --
    Hi Dave, thanks for review. The case here is application bind a DATE_STRUCT to LONGVARCHAR,
and the charset is UCS2.  In the code, we reuse the variable "DataLen" to represent the length
of the data from server side, since the charset is UCS2, so the length is 2 times of the DATE_STRUCT.
After converting the data. DataLen will be used to represent the length of DATE_STRUCT which
user binded.
    BYW, this code was removed from the early commit which for VARHCAR (> 32K) support.
but this line should not be removed. That's why we need this change.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message