patches/gqview-03-remote.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 13214 c3cfbc5a70de
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446

--- gqview-2.0.4/src/remote.c.orig	2008-08-20 17:41:56.656014000 +0800
+++ gqview-2.0.4/src/remote.c	2008-08-20 18:00:55.127044000 +0800
@@ -43,6 +43,7 @@
 {
 	RemoteClient *client = data;
 	RemoteConnection *rc;
+        GIOStatus status;
 
 	rc = client->rc;
 
@@ -54,7 +55,7 @@
 		GError *error = NULL;
 		guint termpos;
 
-		while (g_io_channel_read_line(source, &buffer, NULL, &termpos, &error) == G_IO_STATUS_NORMAL)
+		while ((status = g_io_channel_read_line(source, &buffer, NULL, &termpos, &error)) == G_IO_STATUS_NORMAL)
 			{
 			if (buffer)
 				{
@@ -71,7 +72,16 @@
 
 				buffer = NULL;
 				}
+			
 			}
+  		 if (status == G_IO_STATUS_EOF)
+			  {
+			    rc->clients = g_list_remove(rc->clients, client);
+			    g_source_remove(client->channel_id);
+			    close(client->fd);
+			    g_free(client);
+			    return TRUE;
+			  }
 
 		if (error)
 			{