Before this commit, __astman_get_header would blindly dereference the passed in
'struct message *' to traverse the header list. There are cases, however, such
as '*CLI> sip qualify peer foo' where the message pointer is NULL, so we need
to check for that.
........
Merged revisions 373131 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 373132 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 373133 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373134
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
int x, l = strlen(var);
const char *result = "";
+ if (!m) {
+ return result;
+ }
+
for (x = 0; x < m->hdrcount; x++) {
const char *h = m->headers[x];
if (!strncasecmp(var, h, l) && h[l] == ':') {