]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix memset invocation in mod_skypopen
authorTravis Cross <tc@traviscross.com>
Fri, 26 Jul 2013 01:12:59 +0000 (01:12 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 26 Jul 2013 01:14:50 +0000 (01:14 +0000)
We were previously clearing a pointer's worth of memory rather than
clearing a full element.

This also fixes the build as gcc-4.8 catches this error.

src/mod/endpoints/mod_skypopen/skypopen_protocol.c

index 320c95483bb668e647b02070d106fa8fe09fd07f..b1542a39ccdcb383a8e20942355302ea49fe7d7e 100644 (file)
@@ -522,7 +522,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
                                                                 tech_pvt->chatmessages[i].from_handle, tech_pvt->chatmessages[i].from_dispname, tech_pvt->chatmessages[i].body);
                                                        if (strcmp(tech_pvt->chatmessages[i].from_handle, tech_pvt->skype_user)) {      //if the message was not sent by myself
                                                                incoming_chatmessage(tech_pvt, i);
-                                                               memset(&tech_pvt->chatmessages[i], '\0', sizeof(&tech_pvt->chatmessages[i]));
+                                                               memset(&tech_pvt->chatmessages[i], '\0', sizeof(tech_pvt->chatmessages[i]));
 
                                                                sprintf(msg_to_skype, "SET CHATMESSAGE %s SEEN", id);
                                                                skypopen_signaling_write(tech_pvt, msg_to_skype);
@@ -531,7 +531,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
                                                                        ("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s, chatname=%s, from_handle=%s, from_dispname=%s, body=%s NOT DELETED\n",
                                                                         SKYPOPEN_P_LOG, id, i, tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id, tech_pvt->chatmessages[i].chatname,
                                                                         tech_pvt->chatmessages[i].from_handle, tech_pvt->chatmessages[i].from_dispname, tech_pvt->chatmessages[i].body);
-                                                               memset(&tech_pvt->chatmessages[i], '\0', sizeof(&tech_pvt->chatmessages[i]));
+                                                               memset(&tech_pvt->chatmessages[i], '\0', sizeof(tech_pvt->chatmessages[i]));
                                                                DEBUGA_SKYPE("chatmessage %s HAS BEEN DELETED\n", SKYPOPEN_P_LOG, id);
                                                        }