From: Tilghman Lesher Date: Fri, 5 Mar 2010 04:42:16 +0000 (+0000) Subject: Merged revisions 250913 via svnmerge from X-Git-Tag: 1.6.1.19-rc1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca041ad6cf60e327ef881c7c2e59ca21ba275b85;p=thirdparty%2Fasterisk.git Merged revisions 250913 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r250913 | tilghman | 2010-03-04 22:37:36 -0600 (Thu, 04 Mar 2010) | 7 lines Missing quote in ODBC query. (closes issue #16953) Reported by: elguero Patches: app_voicemail-odbc-syntax-fix.diff uploaded by elguero (license 37) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@250914 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index a615992799..c900864532 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -4686,7 +4686,7 @@ static int messagecount(const char *context, const char *mailbox, const char *fo obj = ast_odbc_request_obj(odbc_database, 0); if (obj) { if (!strcmp(folder, "INBOX")) { - snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/INBOX' OR dir = '%s%s/%s/Urgent", odbc_table, VM_SPOOL_DIR, context, mailbox, VM_SPOOL_DIR, context, mailbox); + snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/INBOX' OR dir = '%s%s/%s/Urgent'", odbc_table, VM_SPOOL_DIR, context, mailbox, VM_SPOOL_DIR, context, mailbox); } else { snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s%s/%s/%s'", odbc_table, VM_SPOOL_DIR, context, mailbox, folder); }