Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1534#discussion_r183770455
--- Diff: core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp ---
@@ -6533,6 +6533,8 @@ odbc_SQLSrvr_ExtractLob_sme_(
if (retcode == SQL_ERROR)
{
ERROR_DESC_def *p_buffer =
QryLobExtractSrvrStmt->sqlError.errorList._buffer;
+ char errNumStr[128];
+ sprintf(errNumStr, "%d", p_buffer->sqlcode);
strncpy(RequestError, p_buffer->errorText,
sizeof(RequestError) - 1);
--- End diff --
Surround code issue. RequestError may not be null terminated when the
RequestError size is less than the length of the string in p_buffer->errorText.
Also, this can cause core dump due to segment violation if length of errorText
is less than the size of RequestBuffer.
---