diff options
author | Ingela Andin <[email protected]> | 2019-01-08 14:29:52 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-01-08 14:29:52 +0100 |
commit | e9eddc4a060a6603a3fb1960c253aa45dd777746 (patch) | |
tree | ece8a4300f7c482f950cc803a0fc6d93d76d261c | |
parent | 2a0dc6e15e4da3bf9652a9cfe2c02cdf3b2bfb68 (diff) | |
parent | 75ae8bc8efa94103d68cb203c1e81088f9c38d32 (diff) | |
download | otp-e9eddc4a060a6603a3fb1960c253aa45dd777746.tar.gz otp-e9eddc4a060a6603a3fb1960c253aa45dd777746.tar.bz2 otp-e9eddc4a060a6603a3fb1960c253aa45dd777746.zip |
Merge pull request #2065 from janchochol/fix-get_diagnos-odbcserver
odbc: Fix stack corruption in get_diagnos in odbcserver
-rw-r--r-- | lib/odbc/c_src/odbcserver.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c index 8c799f6ff1..fb4f61417e 100644 --- a/lib/odbc/c_src/odbcserver.c +++ b/lib/odbc/c_src/odbcserver.c @@ -2749,6 +2749,11 @@ static diagnos get_diagnos(SQLSMALLINT handleType, SQLHANDLE handle, Boolean ext errmsg_buffer_size = errmsg_buffer_size - errmsg_size; acc_errmsg_size = acc_errmsg_size + errmsg_size; current_errmsg_pos = current_errmsg_pos + errmsg_size; + } else if(result == SQL_SUCCESS_WITH_INFO && errmsg_size >= errmsg_buffer_size) { + memcpy(diagnos.sqlState, current_sql_state, SQL_STATE_SIZE); + diagnos.nativeError = nativeError; + acc_errmsg_size = errmsg_buffer_size; + break; } else { break; } |