From b068f8e7b8edf9a41bc047cb8ad08c1e0e428526 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 19 Jun 2009 17:23:57 +0000 Subject: [PATCH] FSCORE-384 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13866 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_odbc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/switch_odbc.c b/src/switch_odbc.c index 5cf8f55de3..edbf76429d 100644 --- a/src/switch_odbc.c +++ b/src/switch_odbc.c @@ -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);