Merged revisions 45999 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Mon, 23 Oct 2006 17:08:53 +0000 (17:08 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 23 Oct 2006 17:08:53 +0000 (17:08 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r45999 | russell | 2006-10-23 13:07:45 -0400 (Mon, 23 Oct 2006) | 2 lines

don't crash when an incoming message has no "from" (issue #8205, jmls)

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46000 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_jabber.c

index 250a988..0a7f5fb 100644 (file)
@@ -1099,7 +1099,8 @@ static void aji_handle_message(struct aji_client *client, ikspak *pak)
                insert->message = ast_strdup(iks_find_cdata(pak->x, "body"));
        if(pak->id)
                ast_copy_string(insert->id, pak->id, sizeof(insert->message));
-       insert->from = ast_strdup(pak->from->full);
+       if (pak->from)
+               insert->from = ast_strdup(pak->from->full);
        AST_LIST_LOCK(&client->messages);
        AST_LIST_TRAVERSE_SAFE_BEGIN(&client->messages, tmp, list) {
                if (flag) {