List:Commits« Previous MessageNext Message »
From:jwinstead Date:August 30 2007 10:13pm
Subject:Connector/ODBC 3.51 commit: r718 - branches/guffert/driver
View as plain text  
Modified:
   branches/guffert/driver/unicode.c
Log:
Don't try to use charset_info in SQLGetInfo() when the
connection hasn't been made yet.

Don't try to write to a NULL pointer in utf8_as_sqlwchar.

Modified: branches/guffert/driver/unicode.c
===================================================================
--- branches/guffert/driver/unicode.c	2007-08-30 00:11:05 UTC (rev 717)
+++ branches/guffert/driver/unicode.c	2007-08-30 22:13:01 UTC (rev 718)
@@ -291,7 +291,8 @@
     }
   }
 
-  *out= 0;
+  if (out)
+    *out= 0;
   return pos - out;
 }
 
@@ -919,7 +920,9 @@
 
   if (char_value)
   {
-    SQLWCHAR *wvalue= sqlchar_as_sqlwchar(dbc->cxn_charset_info,
+    SQLWCHAR *wvalue= sqlchar_as_sqlwchar((dbc->cxn_charset_info ?
+                                           dbc->cxn_charset_info :
+                                           default_charset_info),
                                           char_value, &len, &errors);
 
     if (len > value_max - 1)

Thread
Connector/ODBC 3.51 commit: r718 - branches/guffert/driverjwinstead31 Aug