From: Mark Michelson Date: Fri, 2 May 2014 20:35:16 +0000 (+0000) Subject: Correct variable traversal logic in res_config_odbc's update_odbc function. X-Git-Tag: 12.3.0-rc1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75515f94748d71d627ecfadab242941ccfa440c9;p=thirdparty%2Fasterisk.git Correct variable traversal logic in res_config_odbc's update_odbc function. Closes issue ASTERISK-23675 Reported by Leando Dardini Patches: asterisk-23675-odbc-linkedlist-traversal_12.diff uploaded by Michael L. Young (license #5026) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@413282 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index 21d36afde6..a277e6fdda 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -490,7 +490,7 @@ static int update_odbc(const char *database, const char *table, const char *keyf } snprintf(sql, sizeof(sql), "UPDATE %s SET ", table); - while ((field = field->next)) { + while (field) { if ((tableptr && (column = ast_odbc_find_column(tableptr, field->name))) || count >= 64) { if (paramcount++) { snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), ", ");