]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Two bugs relating to colnames found by Marquis42 on #asterisk-dev
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 7 Nov 2008 22:03:50 +0000 (22:03 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 7 Nov 2008 22:03:50 +0000 (22:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155395 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_odbc.c

index 23cc4f843ac3e4b49cf379175c695a659b644433..e0f4eb3020e8a026c442499cf8ba5199f05f658e 100644 (file)
@@ -376,6 +376,8 @@ static int acf_odbc_read(struct ast_channel *chan, const char *cmd, char *s, cha
                return -1;
        }
 
+       ast_str_reset(colnames);
+
        AST_RWLIST_RDLOCK(&queries);
        AST_RWLIST_TRAVERSE(&queries, query, list) {
                if (!strcmp(query->acf->name, cmd)) {
@@ -531,6 +533,7 @@ static int acf_odbc_read(struct ast_channel *chan, const char *cmd, char *s, cha
                                        colnames->str[colnames->used++] = colname[i];
 
                                        if (colname[i] == '\0') {
+                                               colnames->used--;
                                                break;
                                        }
                                }