changeset 17617:5c0f2eab43d9

Avoid accessing an invalid pointer when ret == -1
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 13 Jun 2007 12:25:13 +0000
parents 7ac75fe490c2
children 778e96d93670
files libpurple/protocols/msn/servconn.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/servconn.c	Wed Jun 13 12:23:00 2007 +0000
+++ b/libpurple/protocols/msn/servconn.c	Wed Jun 13 12:25:13 2007 +0000
@@ -352,7 +352,7 @@
 
 		if (ret < 0 && errno == EAGAIN)
 			ret = 0;
-		if (ret < len) {
+		if (ret >= 0 && ret < len) {
 			if (servconn->tx_handler == -1)
 				servconn->tx_handler = purple_input_add(
 					servconn->fd, PURPLE_INPUT_WRITE,