mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
Fix a few issues related to the handling of channel variables
- in pbx_builtin_serialize_variables(), the variable list traversal would stop on a variables with empty name/values, which is not appropriate - When removing the GROUP variables, use AST_LIST_REMOVE_CURRENT instead of AST_LIST_REMOVE - During masquerading, when copying the variables list from one channel to the other, using AST_LIST_INSERT_TAIL is not valid for appending a whole list. It leaves the tail pointer of the list invalid. Introduce a new macro, AST_LIST_APPEND_LIST that appends a list properly. (issue #7802, softins) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@40994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -429,6 +429,23 @@ struct { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*!
|
||||
\brief Appends a whole list to the tail of a list.
|
||||
\param head This is a pointer to the list head structure
|
||||
\param list This is a pointer to the list to be appended.
|
||||
\param field This is the name of the field (declared using AST_LIST_ENTRY())
|
||||
used to link entries of this list together.
|
||||
*/
|
||||
#define AST_LIST_APPEND_LIST(head, list, field) do { \
|
||||
if (!(head)->first) { \
|
||||
(head)->first = (list)->first; \
|
||||
(head)->last = (list)->last; \
|
||||
} else { \
|
||||
(head)->last->field.next = (list)->first; \
|
||||
(head)->last = (list)->last; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*!
|
||||
\brief Removes and returns the head entry from a list.
|
||||
\param head This is a pointer to the list head structure
|
||||
|
Reference in New Issue
Block a user