From: Tilghman Lesher Date: Fri, 7 Nov 2008 22:03:50 +0000 (+0000) Subject: Two bugs relating to colnames found by Marquis42 on #asterisk-dev X-Git-Tag: 1.6.2.0-beta1~909 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5434edd7ab7a9eb11254e209a43f72f637937a4b;p=thirdparty%2Fasterisk.git Two bugs relating to colnames found by Marquis42 on #asterisk-dev git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155395 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c index 23cc4f843a..e0f4eb3020 100644 --- a/funcs/func_odbc.c +++ b/funcs/func_odbc.c @@ -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; } }