Fix a potential crash when sending the MSN BYE command.

Submitted by:	Jeremy Johnston <jeremy@smart-serv.net>
Obtained from:	Gaim CVS
This commit is contained in:
Joe Marcus Clarke 2004-05-12 03:23:38 +00:00
parent d3399fc581
commit 1c66f13280
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=108965
4 changed files with 92 additions and 2 deletions

View file

@ -6,7 +6,7 @@
PORTNAME= gaim
PORTVERSION= 0.77
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES?= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}

View file

@ -0,0 +1,45 @@
diff -urp msn-old/servconn.c msn/servconn.c
--- src/protocols/msn-old/servconn.c 2004-05-07 22:59:52.240091544 -0500
+++ src/protocols/msn/servconn.c 2004-05-07 23:00:21.214686736 -0500
@@ -201,6 +201,12 @@ msn_servconn_destroy(MsnServConn *servco
g_return_if_fail(servconn != NULL);
+ if (servconn->processing)
+ {
+ servconn->wasted = TRUE;
+ return;
+ }
+
session = servconn->session;
session->servconns = g_list_remove(session->servconns, servconn);
@@ -568,6 +574,8 @@ read_cb(gpointer data, gint source, Gaim
end = old_rx_buf = servconn->rx_buf;
+ servconn->processing = TRUE;
+
do
{
cur = end;
@@ -608,6 +616,8 @@ read_cb(gpointer data, gint source, Gaim
}
} while (servconn->connected && servconn->rx_len);
+ servconn->processing = FALSE;
+
if (servconn->connected)
{
if (servconn->rx_len)
diff -urp msn-old/servconn.h msn/servconn.h
--- src/protocols/msn-old/servconn.h 2004-04-12 23:08:22.000000000 -0500
+++ src/protocols/msn/servconn.h 2004-05-06 02:07:03.000000000 -0500
@@ -45,6 +45,7 @@ struct _MsnServConn
MsnSession *session;
gboolean connected;
+ gboolean processing;
gboolean wasted;
MsnHttpMethodData *http_data;

View file

@ -6,7 +6,7 @@
PORTNAME= gaim
PORTVERSION= 0.77
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES?= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}

View file

@ -0,0 +1,45 @@
diff -urp msn-old/servconn.c msn/servconn.c
--- src/protocols/msn-old/servconn.c 2004-05-07 22:59:52.240091544 -0500
+++ src/protocols/msn/servconn.c 2004-05-07 23:00:21.214686736 -0500
@@ -201,6 +201,12 @@ msn_servconn_destroy(MsnServConn *servco
g_return_if_fail(servconn != NULL);
+ if (servconn->processing)
+ {
+ servconn->wasted = TRUE;
+ return;
+ }
+
session = servconn->session;
session->servconns = g_list_remove(session->servconns, servconn);
@@ -568,6 +574,8 @@ read_cb(gpointer data, gint source, Gaim
end = old_rx_buf = servconn->rx_buf;
+ servconn->processing = TRUE;
+
do
{
cur = end;
@@ -608,6 +616,8 @@ read_cb(gpointer data, gint source, Gaim
}
} while (servconn->connected && servconn->rx_len);
+ servconn->processing = FALSE;
+
if (servconn->connected)
{
if (servconn->rx_len)
diff -urp msn-old/servconn.h msn/servconn.h
--- src/protocols/msn-old/servconn.h 2004-04-12 23:08:22.000000000 -0500
+++ src/protocols/msn/servconn.h 2004-05-06 02:07:03.000000000 -0500
@@ -45,6 +45,7 @@ struct _MsnServConn
MsnSession *session;
gboolean connected;
+ gboolean processing;
gboolean wasted;
MsnHttpMethodData *http_data;