]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-384
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 19 Jun 2009 17:23:57 +0000 (17:23 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 19 Jun 2009 17:23:57 +0000 (17:23 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13866 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_odbc.c

index 5cf8f55de3300b434d22e6b26c6a8f8db340b513..edbf76429db5fd460850b0b9839cbc450689450e 100644 (file)
@@ -388,12 +388,16 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(c
                switch_assert(names && vals);
 
                for (x = 1; x <= c; x++) {
-                       SQLSMALLINT NameLength, DataType, DecimalDigits, Nullable;
-                       SQLULEN ColumnSize;
+                       SQLSMALLINT NameLength = 0, DataType = 0, DecimalDigits = 0, Nullable = 0;
+                       SQLULEN ColumnSize = 0;
                        names[y] = malloc(name_len);
                        memset(names[y], 0, name_len);
 
                        SQLDescribeCol(stmt, x, (SQLCHAR *) names[y], (SQLSMALLINT) name_len, &NameLength, &DataType, &ColumnSize, &DecimalDigits, &Nullable);
+
+                       if (!ColumnSize) {
+                               ColumnSize = 255;
+                       }
                        ColumnSize++;
 
                        vals[y] = malloc(ColumnSize);