1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
http://bugs.gentoo.org/show_bug.cgi?id=358611
--- unixODBC-2.3.0.orig/DriverManager/SQLDriverConnect.c 2011-04-02 21:56:19.889301819 +0400
+++ unixODBC-2.3.0/DriverManager/SQLDriverConnect.c 2011-04-02 21:58:37.129102095 +0400
@@ -639,7 +639,7 @@
{
DMHDBC connection = (DMHDBC)hdbc;
struct con_struct con_struct;
- char *driver, *dsn = NULL, *filedsn, *tsavefile, savefile[ 128 ];
+ char *driver, *dsn = NULL, *filedsn, *tsavefile, savefile[ INI_MAX_PROPERTY_VALUE + 1 ];
char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ];
char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ];
SQLRETURN ret_from_connect;
@@ -944,7 +944,13 @@
tsavefile = __get_attribute_value( &con_struct, "SAVEFILE" );
if ( tsavefile )
{
- strcpy( savefile, tsavefile );
+ if ( strlen( tsavefile ) > INI_MAX_PROPERTY_VALUE ) {
+ memcpy( savefile, tsavefile, INI_MAX_PROPERTY_VALUE );
+ savefile[ INI_MAX_PROPERTY_VALUE ] = '\0';
+ }
+ else {
+ strcpy( savefile, tsavefile );
+ }
}
else
{
|