/pidgin/main: 3e04feabcbfb: Fix some Coverity CWE-457 bugs

Tomasz Wasilczyk twasilczyk at pidgin.im
Wed Apr 30 19:45:33 EDT 2014


Changeset: 3e04feabcbfba01894ac4b1bd726196df7664448
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-05-01 01:45 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/3e04feabcbfb

Description:

Fix some Coverity CWE-457 bugs

diffstat:

 libpurple/plugins/log_reader.c         |  2 ++
 libpurple/protocols/zephyr/ZOpenPort.c |  1 +
 libpurple/stun.c                       |  2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)

diffs (35 lines):

diff --git a/libpurple/plugins/log_reader.c b/libpurple/plugins/log_reader.c
--- a/libpurple/plugins/log_reader.c
+++ b/libpurple/plugins/log_reader.c
@@ -1779,6 +1779,8 @@ static GList *qip_logger_list(PurpleLogT
 	g_return_val_if_fail(sn != NULL, NULL);
 	g_return_val_if_fail(account != NULL, NULL);
 
+	memset(&tm, 0, sizeof(tm));
+
 	/* QIP only supports ICQ. */
 	if (strcmp(account->protocol_id, "prpl-icq"))
 		return NULL;
diff --git a/libpurple/protocols/zephyr/ZOpenPort.c b/libpurple/protocols/zephyr/ZOpenPort.c
--- a/libpurple/protocols/zephyr/ZOpenPort.c
+++ b/libpurple/protocols/zephyr/ZOpenPort.c
@@ -22,6 +22,7 @@ Code_t ZOpenPort(port)
     socklen_t len;
 
     (void) ZClosePort();
+    memset(&bindin, 0, sizeof(bindir));
 
     if ((__Zephyr_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
 	__Zephyr_fd = -1;
diff --git a/libpurple/stun.c b/libpurple/stun.c
--- a/libpurple/stun.c
+++ b/libpurple/stun.c
@@ -174,6 +174,8 @@ static void reply_cb(gpointer data, gint
 	struct ifreq *ifr;
 	struct sockaddr_in *sinptr;
 
+	memset(&in, 0, sizeof(in));
+
 	len = recv(source, buffer, sizeof(buffer) - 1, 0);
 	if (len < 0) {
 		purple_debug_warning("stun", "unable to read stun response\n");



More information about the Commits mailing list