From: Automerge script Date: Tue, 18 Sep 2012 20:25:16 +0000 (+0000) Subject: Merged revisions 373132 via svnmerge from X-Git-Tag: 10.10.0-digiumphones-rc1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa607062494e6b32d9ac3428649017316e782ab5;p=thirdparty%2Fasterisk.git Merged revisions 373132 via svnmerge from file:///srv/subversion/repos/asterisk/branches/10 ................ r373132 | seanbright | 2012-09-18 15:13:21 -0500 (Tue, 18 Sep 2012) | 10 lines Don't crash when passing a NULL message to __astman_get_header. 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 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@373158 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/manager.c b/main/manager.c index 4b791c02f4..129f4468e7 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1832,6 +1832,10 @@ static const char *__astman_get_header(const struct message *m, char *var, int m 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] == ':') {