You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-db/unixODBC/files/unixODBC-2.3.0-sqldrivercon...

28 lines
1.0 KiB

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
{