]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Correct variable traversal logic in res_config_odbc's update_odbc function.
authorMark Michelson <mmichelson@digium.com>
Fri, 2 May 2014 20:35:16 +0000 (20:35 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 2 May 2014 20:35:16 +0000 (20:35 +0000)
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

res/res_config_odbc.c

index 21d36afde61caf4e7487f814faf88cd810989da1..a277e6fdda4c2b02921f65f921b21c1cc82c0875 100644 (file)
@@ -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), ", ");