aboutsummaryrefslogtreecommitdiffstats
path: root/lib/odbc
diff options
context:
space:
mode:
authorIngela Andin <[email protected]>2019-01-08 14:29:52 +0100
committerGitHub <[email protected]>2019-01-08 14:29:52 +0100
commite9eddc4a060a6603a3fb1960c253aa45dd777746 (patch)
treeece8a4300f7c482f950cc803a0fc6d93d76d261c /lib/odbc
parent2a0dc6e15e4da3bf9652a9cfe2c02cdf3b2bfb68 (diff)
parent75ae8bc8efa94103d68cb203c1e81088f9c38d32 (diff)
downloadotp-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
Diffstat (limited to 'lib/odbc')
-rw-r--r--lib/odbc/c_src/odbcserver.c5
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;
}