]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Initialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 10 Mar 2011 05:38:44 +0000 (05:38 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 10 Mar 2011 05:38:44 +0000 (05:38 +0000)
(closes issue #18295)
 Reported by: pruiz

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@310140 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c
res/res_config_odbc.c

index 71bdbb45d6ad6a107c09d8df7dc9611de2b4db26..f8948faf6d0f0e893c9093358883efef0edb355e 100644 (file)
@@ -2473,6 +2473,7 @@ static int retrieve_file(char *dir, int msgnum)
                        fprintf(f, "[message]\n");
                for (x=0;x<colcount;x++) {
                        rowdata[0] = '\0';
+                       colsize = 0;
                        collen = sizeof(coltitle);
                        res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen, 
                                                &datatype, &colsize, &decimaldigits, &nullable);
index 52913507d4e1d3ad4c97f561724ecbf4bc009f4e..cb389bafd1a42b028dd019da23d435c596233fb2 100644 (file)
@@ -223,6 +223,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
        }
        for (x = 0; x < colcount; x++) {
                rowdata[0] = '\0';
+               colsize = 0;
                collen = sizeof(coltitle);
                res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen, 
                                        &datatype, &colsize, &decimaldigits, &nullable);
@@ -377,6 +378,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
                }
                for (x=0;x<colcount;x++) {
                        rowdata[0] = '\0';
+                       colsize = 0;
                        collen = sizeof(coltitle);
                        res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen, 
                                                &datatype, &colsize, &decimaldigits, &nullable);