Compare commits
10 Commits
b5b9fedcbd
...
e31e1be795
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e31e1be795 | ||
|
|
a064251355 | ||
|
|
f236e31e8f | ||
|
|
6facb056fd | ||
|
|
0ff8985a0b | ||
|
|
56a56b8b1b | ||
|
|
4d05d26268 | ||
|
|
02e867baf7 | ||
|
|
592077ebb7 | ||
|
|
61665685ad |
47
backport-0001-CVE-2024-1013.patch
Normal file
47
backport-0001-CVE-2024-1013.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From 42e2713db65f5b1ea4d52ba7832b4b644965d7ee Mon Sep 17 00:00:00 2001
|
||||
From: hanqiudan <hanqiudan@huawei.com>
|
||||
Date: Sat, 23 Mar 2024 12:22:38 +0800
|
||||
Subject: [PATCH] [Backport] fix CVE-2024-1013
|
||||
|
||||
Offering:EulerOS Server
|
||||
CVE:CVE-2024-1013
|
||||
Reference:https://github.com/lurcher/unixODBC/commit/45f501e1be2db6b017cc242c79bfb9de32b332a1
|
||||
Type:CVE
|
||||
reason:fix CVE-2024-1013
|
||||
---
|
||||
Drivers/Postgre7.1/info.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Drivers/Postgre7.1/info.c b/Drivers/Postgre7.1/info.c
|
||||
index 63ac91f..2216ecd 100755
|
||||
--- a/Drivers/Postgre7.1/info.c
|
||||
+++ b/Drivers/Postgre7.1/info.c
|
||||
@@ -1779,14 +1779,14 @@ char *table_name;
|
||||
char index_name[MAX_INFO_STRING];
|
||||
short fields_vector[8];
|
||||
char isunique[10], isclustered[10];
|
||||
-SDWORD index_name_len, fields_vector_len;
|
||||
+SQLLEN index_name_len, fields_vector_len;
|
||||
TupleNode *row;
|
||||
int i;
|
||||
HSTMT hcol_stmt;
|
||||
StatementClass *col_stmt, *indx_stmt;
|
||||
char column_name[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING];
|
||||
char **column_names = 0;
|
||||
-Int4 column_name_len;
|
||||
+SQLLEN column_name_len;
|
||||
int total_columns = 0;
|
||||
char error = TRUE;
|
||||
ConnInfo *ci;
|
||||
@@ -2136,7 +2136,7 @@ HSTMT htbl_stmt;
|
||||
StatementClass *tbl_stmt;
|
||||
char tables_query[STD_STATEMENT_LEN];
|
||||
char attname[MAX_INFO_STRING];
|
||||
-SDWORD attname_len;
|
||||
+SQLLEN attname_len;
|
||||
char pktab[MAX_TABLE_LEN + 1];
|
||||
Int2 result_cols;
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
443
fix_leaks.patch
Normal file
443
fix_leaks.patch
Normal file
@ -0,0 +1,443 @@
|
||||
diff -uprN unixODBC-2.3.7/cur/SQLAllocStmt.c unixODBC-2.3.7-revised/cur/SQLAllocStmt.c
|
||||
--- unixODBC-2.3.7/cur/SQLAllocStmt.c 2018-02-26 22:50:10.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/cur/SQLAllocStmt.c 2021-11-05 16:23:24.000000000 +0800
|
||||
@@ -83,7 +83,7 @@ SQLRETURN CLAllocStmt( SQLHDBC connectio
|
||||
LOG_INFO,
|
||||
"Error: IM001" );
|
||||
|
||||
- cl_statement -> cl_connection -> dh.__post_internal_error( &connection -> error,
|
||||
+ cl_connection -> dh.__post_internal_error( &connection -> error,
|
||||
ERROR_HY001, NULL,
|
||||
connection -> environment -> requested_version );
|
||||
|
||||
diff -uprN unixODBC-2.3.7/cur/SQLConnect.c unixODBC-2.3.7-revised/cur/SQLConnect.c
|
||||
--- unixODBC-2.3.7/cur/SQLConnect.c 2018-02-26 22:50:10.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/cur/SQLConnect.c 2021-11-05 16:23:59.000000000 +0800
|
||||
@@ -299,6 +299,8 @@ SQLRETURN CLConnect( DMHDBC connection,
|
||||
cl_connection -> dh.__post_internal_error( &connection -> error,
|
||||
ERROR_HY001, NULL,
|
||||
connection -> environment -> requested_version );
|
||||
+
|
||||
+ free( cl_connection );
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
diff -uprN unixODBC-2.3.7/DriverManager/SQLCancel.c unixODBC-2.3.7-revised/DriverManager/SQLCancel.c
|
||||
--- unixODBC-2.3.7/DriverManager/SQLCancel.c 2018-05-30 17:24:07.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/DriverManager/SQLCancel.c 2021-11-05 16:21:33.000000000 +0800
|
||||
@@ -236,18 +236,8 @@ SQLRETURN SQLCancel( SQLHSTMT statement_
|
||||
else if ( statement -> interupted_func ==
|
||||
SQL_API_SQLBULKOPERATIONS )
|
||||
{
|
||||
- if ( statement -> interupted_state == STATE_S5 ||
|
||||
- statement -> interupted_state == STATE_S6 ||
|
||||
- statement -> interupted_state == STATE_S7 )
|
||||
- {
|
||||
- statement -> state = STATE_S6;
|
||||
- statement -> eod = 0;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- statement -> state = STATE_S6;
|
||||
- statement -> eod = 0;
|
||||
- }
|
||||
+ statement -> state = STATE_S6;
|
||||
+ statement -> eod = 0;
|
||||
}
|
||||
else if ( statement -> interupted_func ==
|
||||
SQL_API_SQLSETPOS )
|
||||
diff -uprN unixODBC-2.3.7/DriverManager/SQLCancelHandle.c unixODBC-2.3.7-revised/DriverManager/SQLCancelHandle.c
|
||||
--- unixODBC-2.3.7/DriverManager/SQLCancelHandle.c 2018-05-30 17:24:07.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/DriverManager/SQLCancelHandle.c 2021-11-05 16:22:12.000000000 +0800
|
||||
@@ -140,18 +140,8 @@ SQLRETURN SQLCancelHandle( SQLSMALLINT H
|
||||
else if ( statement -> interupted_func ==
|
||||
SQL_API_SQLBULKOPERATIONS )
|
||||
{
|
||||
- if ( statement -> interupted_state == STATE_S5 ||
|
||||
- statement -> interupted_state == STATE_S6 ||
|
||||
- statement -> interupted_state == STATE_S7 )
|
||||
- {
|
||||
- statement -> state = STATE_S6;
|
||||
- statement -> eod = 0;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- statement -> state = STATE_S6;
|
||||
- statement -> eod = 0;
|
||||
- }
|
||||
+ statement -> state = STATE_S6;
|
||||
+ statement -> eod = 0;
|
||||
}
|
||||
else if ( statement -> interupted_func ==
|
||||
SQL_API_SQLSETPOS )
|
||||
diff -uprN unixODBC-2.3.7/DriverManager/SQLGetConnectOption.c unixODBC-2.3.7-revised/DriverManager/SQLGetConnectOption.c
|
||||
--- unixODBC-2.3.7/DriverManager/SQLGetConnectOption.c 2018-05-30 17:24:07.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/DriverManager/SQLGetConnectOption.c 2021-11-05 16:22:40.000000000 +0800
|
||||
@@ -171,14 +171,7 @@ SQLRETURN SQLGetConnectOption( SQLHDBC c
|
||||
{
|
||||
if ( value )
|
||||
{
|
||||
- if ( log_info.log_flag )
|
||||
- {
|
||||
- *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON;
|
||||
- }
|
||||
+ *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON;
|
||||
}
|
||||
|
||||
return SQL_SUCCESS;
|
||||
diff -uprN unixODBC-2.3.7/DriverManager/SQLGetConnectOptionW.c unixODBC-2.3.7-revised/DriverManager/SQLGetConnectOptionW.c
|
||||
--- unixODBC-2.3.7/DriverManager/SQLGetConnectOptionW.c 2018-05-30 17:24:07.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/DriverManager/SQLGetConnectOptionW.c 2021-11-05 16:23:01.000000000 +0800
|
||||
@@ -110,14 +110,7 @@ SQLRETURN SQLGetConnectOptionW( SQLHDBC
|
||||
{
|
||||
if ( value )
|
||||
{
|
||||
- if ( log_info.log_flag )
|
||||
- {
|
||||
- *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON;
|
||||
- }
|
||||
+ *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON;
|
||||
}
|
||||
|
||||
return SQL_SUCCESS;
|
||||
diff -uprN unixODBC-2.3.7/odbcinst/ODBCINSTConstructProperties.c unixODBC-2.3.7-revised/odbcinst/ODBCINSTConstructProperties.c
|
||||
--- unixODBC-2.3.7/odbcinst/ODBCINSTConstructProperties.c 2015-01-23 18:32:51.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/odbcinst/ODBCINSTConstructProperties.c 2021-11-05 16:25:19.000000000 +0800
|
||||
@@ -244,6 +244,8 @@ int ODBCINSTConstructProperties( char *p
|
||||
/* APPEND OTHERS */
|
||||
pODBCINSTGetProperties( hLastProperty );
|
||||
|
||||
+ lt_dlclose( hDLL );
|
||||
+
|
||||
return ODBCINST_SUCCESS;
|
||||
}
|
||||
|
||||
diff -uprN unixODBC-2.3.7/odbcinst/SQLConfigDriver.c unixODBC-2.3.7-revised/odbcinst/SQLConfigDriver.c
|
||||
--- unixODBC-2.3.7/odbcinst/SQLConfigDriver.c 2015-01-23 18:31:25.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/odbcinst/SQLConfigDriver.c 2021-11-05 16:26:47.000000000 +0800
|
||||
@@ -24,7 +24,6 @@ static BOOL SQLConfigDriverWide( HWND hW
|
||||
LPWSTR pszMsgW,
|
||||
int *iswide )
|
||||
{
|
||||
- BOOL nReturn;
|
||||
void *hDLL;
|
||||
BOOL (*pConfigDriver)( HWND, WORD, LPCSTR, LPCSTR, LPCSTR, WORD, WORD * );
|
||||
BOOL (*pConfigDriverW)( HWND, WORD, LPCWSTR, LPCWSTR, LPCWSTR, WORD, WORD * );
|
||||
@@ -36,7 +35,6 @@ static BOOL SQLConfigDriverWide( HWND hW
|
||||
*iswide = 0;
|
||||
|
||||
/* SANITY CHECKS */
|
||||
- nReturn = FALSE;
|
||||
if ( pszDriver == NULL )
|
||||
{
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" );
|
||||
@@ -109,14 +107,17 @@ static BOOL SQLConfigDriverWide( HWND hW
|
||||
pConfigDriverW = (BOOL (*)(HWND, WORD, LPCWSTR, LPCWSTR, LPCWSTR, WORD, WORD * )) lt_dlsym( hDLL, "ConfigDriverW" );
|
||||
/* if ( lt_dlerror() == NULL ) */
|
||||
if ( pConfigDriver )
|
||||
- nReturn = pConfigDriver( hWnd, nRequest, pszDriver, pszArgs, pszMsg, nMsgMax, pnMsgOut);
|
||||
+ (void) pConfigDriver( hWnd, nRequest, pszDriver, pszArgs, pszMsg, nMsgMax, pnMsgOut);
|
||||
else if ( pConfigDriverW )
|
||||
{
|
||||
- nReturn = pConfigDriverW( hWnd, nRequest, pszDriverW, pszArgsW, pszMsgW, nMsgMax, pnMsgOut);
|
||||
+ (void) pConfigDriverW( hWnd, nRequest, pszDriverW, pszArgsW, pszMsgW, nMsgMax, pnMsgOut);
|
||||
*iswide = 1;
|
||||
}
|
||||
else
|
||||
+ {
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" );
|
||||
+ }
|
||||
+ lt_dlclose( hDLL );
|
||||
}
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" );
|
||||
diff -uprN unixODBC-2.3.7/odbcinst/SQLCreateDataSource.c unixODBC-2.3.7-revised/odbcinst/SQLCreateDataSource.c
|
||||
--- unixODBC-2.3.7/odbcinst/SQLCreateDataSource.c 2018-06-28 19:13:00.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/odbcinst/SQLCreateDataSource.c 2021-11-05 16:31:48.000000000 +0800
|
||||
@@ -242,10 +242,18 @@ BOOL SQLCreateDataSource( HWND hWnd, LPC
|
||||
{
|
||||
/* change the name, as it avoids it finding it in the calling lib */
|
||||
pSQLCreateDataSource = (BOOL (*)(HWND, LPCSTR))lt_dlsym( hDLL, "ODBCCreateDataSource" );
|
||||
- if ( pSQLCreateDataSource )
|
||||
- return pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), pszDS );
|
||||
+
|
||||
+ if ( pSQLCreateDataSource ) {
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), pszDS );
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
+ }
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() );
|
||||
+ lt_dlclose( hDLL );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -256,10 +264,18 @@ BOOL SQLCreateDataSource( HWND hWnd, LPC
|
||||
{
|
||||
/* change the name, as it avoids linker finding it in the calling lib */
|
||||
pSQLCreateDataSource = (BOOL (*)(HWND,LPCSTR))lt_dlsym( hDLL, "ODBCCreateDataSource" );
|
||||
- if ( pSQLCreateDataSource )
|
||||
- return pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), pszDS );
|
||||
+
|
||||
+ if ( pSQLCreateDataSource ) {
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), pszDS );
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
+ }
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() );
|
||||
+ lt_dlclose( hDLL );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,10 +324,17 @@ BOOL INSTAPI SQLCreateDataSourceW( HWND
|
||||
{
|
||||
/* change the name, as it avoids it finding it in the calling lib */
|
||||
pSQLCreateDataSource = (BOOL (*)(HWND, LPCWSTR))lt_dlsym( hDLL, "ODBCCreateDataSourceW" );
|
||||
- if ( pSQLCreateDataSource )
|
||||
- return pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), lpszDSN );
|
||||
+ if ( pSQLCreateDataSource ) {
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), lpszDSN );
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
+ }
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() );
|
||||
+ lt_dlclose( hDLL );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -322,10 +345,17 @@ BOOL INSTAPI SQLCreateDataSourceW( HWND
|
||||
{
|
||||
/* change the name, as it avoids linker finding it in the calling lib */
|
||||
pSQLCreateDataSource = (BOOL (*)(HWND,LPCWSTR))lt_dlsym( hDLL, "ODBCCreateDataSourceW" );
|
||||
- if ( pSQLCreateDataSource )
|
||||
- return pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), lpszDSN );
|
||||
+ if ( pSQLCreateDataSource ) {
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), lpszDSN );
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
+ }
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() );
|
||||
+ lt_dlclose( hDLL );
|
||||
}
|
||||
}
|
||||
|
||||
diff -uprN unixODBC-2.3.7/odbcinst/_SQLDriverConnectPrompt.c unixODBC-2.3.7-revised/odbcinst/_SQLDriverConnectPrompt.c
|
||||
--- unixODBC-2.3.7/odbcinst/_SQLDriverConnectPrompt.c 2018-04-03 18:34:02.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/odbcinst/_SQLDriverConnectPrompt.c 2021-11-05 16:40:43.000000000 +0800
|
||||
@@ -12,6 +12,7 @@ BOOL _SQLDriverConnectPrompt(
|
||||
char szPathAndName[FILENAME_MAX];
|
||||
void * hDLL;
|
||||
BOOL (*pODBCDriverConnectPrompt)(HWND, SQLCHAR *, SQLSMALLINT );
|
||||
+ BOOL ret;
|
||||
|
||||
/* initialize libtool */
|
||||
if ( lt_dlinit() )
|
||||
@@ -40,17 +41,21 @@ BOOL _SQLDriverConnectPrompt(
|
||||
{
|
||||
if ( hODBCInstWnd )
|
||||
{
|
||||
- return pODBCDriverConnectPrompt(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPrompt(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
}
|
||||
else
|
||||
{
|
||||
- return pODBCDriverConnectPrompt( NULL, dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPrompt( NULL, dsn, len_dsn );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
- return FALSE;
|
||||
+ ret = FALSE;
|
||||
}
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -65,17 +70,20 @@ BOOL _SQLDriverConnectPrompt(
|
||||
{
|
||||
if ( hODBCInstWnd )
|
||||
{
|
||||
- return pODBCDriverConnectPrompt(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPrompt(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
}
|
||||
else
|
||||
{
|
||||
- return pODBCDriverConnectPrompt( NULL, dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPrompt( NULL, dsn, len_dsn );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
- return FALSE;
|
||||
+ ret = FALSE;
|
||||
}
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +101,7 @@ BOOL _SQLDriverConnectPromptW(
|
||||
char szPathAndName[FILENAME_MAX];
|
||||
void * hDLL;
|
||||
BOOL (*pODBCDriverConnectPromptW)(HWND, SQLWCHAR *, SQLSMALLINT );
|
||||
+ BOOL ret;
|
||||
|
||||
/* initialize libtool */
|
||||
if ( lt_dlinit() )
|
||||
@@ -121,17 +130,20 @@ BOOL _SQLDriverConnectPromptW(
|
||||
{
|
||||
if ( hODBCInstWnd )
|
||||
{
|
||||
- return pODBCDriverConnectPromptW(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPromptW(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
}
|
||||
else
|
||||
{
|
||||
- return pODBCDriverConnectPromptW( NULL, dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPromptW( NULL, dsn, len_dsn );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
- return FALSE;
|
||||
+ ret = FALSE;
|
||||
}
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -146,17 +158,20 @@ BOOL _SQLDriverConnectPromptW(
|
||||
{
|
||||
if ( hODBCInstWnd )
|
||||
{
|
||||
- return pODBCDriverConnectPromptW(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPromptW(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn );
|
||||
}
|
||||
else
|
||||
{
|
||||
- return pODBCDriverConnectPromptW( NULL, dsn, len_dsn );
|
||||
+ ret = pODBCDriverConnectPromptW( NULL, dsn, len_dsn );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
- return FALSE;
|
||||
+ ret = FALSE;
|
||||
}
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
}
|
||||
}
|
||||
|
||||
diff -uprN unixODBC-2.3.7/odbcinst/SQLManageDataSources.c unixODBC-2.3.7-revised/odbcinst/SQLManageDataSources.c
|
||||
--- unixODBC-2.3.7/odbcinst/SQLManageDataSources.c 2018-03-28 17:04:04.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/odbcinst/SQLManageDataSources.c 2021-11-05 16:36:24.000000000 +0800
|
||||
@@ -153,10 +153,16 @@ BOOL SQLManageDataSources( HWND hWnd )
|
||||
{
|
||||
/* change the name (SQLManageDataSources to ODBCManageDataSources) to prevent us from calling ourself */
|
||||
pSQLManageDataSources = (BOOL (*)(HWND))lt_dlsym( hDLL, "ODBCManageDataSources" );
|
||||
- if ( pSQLManageDataSources )
|
||||
- return pSQLManageDataSources( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ) );
|
||||
+ if ( pSQLManageDataSources ) {
|
||||
+ BOOL ret;
|
||||
+ ret = pSQLManageDataSources( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ) );
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
+ }
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() );
|
||||
+ lt_dlclose( hDLL );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -169,10 +175,17 @@ BOOL SQLManageDataSources( HWND hWnd )
|
||||
/* change the name (SQLManageDataSources to ODBCManageDataSources) to prevent us from calling ourself */
|
||||
/* its only safe to use hWnd if szUI was specified by the caller */
|
||||
pSQLManageDataSources = (BOOL (*)(HWND))lt_dlsym( hDLL, "ODBCManageDataSources" );
|
||||
- if ( pSQLManageDataSources )
|
||||
- return pSQLManageDataSources( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ) );
|
||||
+ if ( pSQLManageDataSources ) {
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ ret = pSQLManageDataSources( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ) );
|
||||
+
|
||||
+ lt_dlclose( hDLL );
|
||||
+ return ret;
|
||||
+ }
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() );
|
||||
+ lt_dlclose( hDLL );
|
||||
}
|
||||
else
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() );
|
||||
diff -uprN unixODBC-2.3.7/odbcinst/SQLReadFileDSN.c unixODBC-2.3.7-revised/odbcinst/SQLReadFileDSN.c
|
||||
--- unixODBC-2.3.7/odbcinst/SQLReadFileDSN.c 2014-01-06 17:37:02.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/odbcinst/SQLReadFileDSN.c 2021-11-05 16:37:43.000000000 +0800
|
||||
@@ -87,7 +87,6 @@ BOOL SQLReadFileDSN( LPCSTR
|
||||
WORD *pnString )
|
||||
{
|
||||
HINI hIni;
|
||||
- int nBufPos = 0;
|
||||
char szValue[INI_MAX_PROPERTY_VALUE+1];
|
||||
char szFileName[ODBC_FILENAME_MAX+1];
|
||||
|
||||
@@ -186,6 +185,10 @@ BOOL SQLReadFileDSN( LPCSTR
|
||||
inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL,
|
||||
ODBC_ERROR_REQUEST_FAILED, "" );
|
||||
|
||||
+ if ( pszFileName )
|
||||
+ {
|
||||
+ iniClose( hIni );
|
||||
+ }
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
@@ -193,7 +196,6 @@ BOOL SQLReadFileDSN( LPCSTR
|
||||
iniValue( hIni, szValue );
|
||||
strncpy( pszString, szValue, nString );
|
||||
pszString[ nString - 1 ] = '\0';
|
||||
- nBufPos = strlen( szValue );
|
||||
}
|
||||
}
|
||||
|
||||
diff -uprN unixODBC-2.3.7/.vscode/settings.json unixODBC-2.3.7-revised/.vscode/settings.json
|
||||
--- unixODBC-2.3.7/.vscode/settings.json 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ unixODBC-2.3.7-revised/.vscode/settings.json 2021-11-05 16:20:50.000000000 +0800
|
||||
@@ -0,0 +1,4 @@
|
||||
+{
|
||||
+ "C_Cpp.autocomplete": "Disabled",
|
||||
+ "C_Cpp.intelliSenseEngine": "Disabled"
|
||||
+}
|
||||
\ No newline at end of file
|
||||
@ -1,6 +1,6 @@
|
||||
Name: unixODBC
|
||||
Version: 2.3.7
|
||||
Release: 2
|
||||
Release: 4
|
||||
Summary: Open-source project that implements the ODBC API
|
||||
License: GPLv2+ and LGPLv2+
|
||||
URL: http://www.unixODBC.org/
|
||||
@ -8,9 +8,10 @@ Source: http://www.unixODBC.org/%{name}-%{version}.tar.gz
|
||||
Source1: odbcinst.ini
|
||||
Patch0000: so-version-bump.patch
|
||||
Patch0001: keep-typedefs.patch
|
||||
Patch0002: fix_leaks.patch
|
||||
Patch0003: backport-0001-CVE-2024-1013.patch
|
||||
Conflicts: iodbc
|
||||
BuildRequires: automake autoconf libtool libtool-ltdl-devel bison flex
|
||||
BuildRequires: readline-devel multilib-rpm-config
|
||||
BuildRequires: automake autoconf libtool libtool-ltdl-devel bison flex readline-devel
|
||||
|
||||
%description
|
||||
The unixODBC Project goals are to develop and promote unixODBC to be the
|
||||
@ -43,7 +44,6 @@ make all
|
||||
%install
|
||||
%make_install
|
||||
install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
|
||||
%multilib_fix_c_header --file %{_includedir}/unixodbc_conf.h
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/libodbcpsql.so*
|
||||
find doc -name 'Makefile*' | xargs rm
|
||||
|
||||
@ -92,5 +92,14 @@ find doc -name 'Makefile*' | xargs rm
|
||||
%exclude %{_datadir}/libtool
|
||||
|
||||
%changelog
|
||||
* Thu Jun 27 2024 zhang_chunjing <zhang_chunjing@hoperun.com> - 2.3.7-4
|
||||
- Modify the version to fix the upgrade issue
|
||||
|
||||
* Sat Mar 23 2024 hanqiudan <hanqiudan@huawei.com> - 2.3.7-3.h1
|
||||
- fix CVE-2024-1013
|
||||
|
||||
* Mon Nov 8 2021 Haoran Yang <yanghaoran7@huawei.com> - 2.3.7-3
|
||||
- fix some leaks and eliminate duplicated code
|
||||
|
||||
* Tue Nov 5 2019 Lijin Yang <yanglijin@huawei.com> - 1.1.0-14
|
||||
- Package init
|
||||
|
||||
4
unixODBC.yaml
Normal file
4
unixODBC.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: svn
|
||||
src_repo: https://svn.code.sf.net/p/unixodbc/code/
|
||||
tag_prefix: 2.3.0
|
||||
seperator: .
|
||||
Loading…
x
Reference in New Issue
Block a user