Mercurial > pidgin
comparison libpurple/protocols/msn/servconn.c @ 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 | 7a493fc1e763 |
children | 39248f5b53ad 69febfa6d307 |
comparison
equal
deleted
inserted
replaced
17616:7ac75fe490c2 | 17617:5c0f2eab43d9 |
---|---|
350 errno = EAGAIN; | 350 errno = EAGAIN; |
351 } | 351 } |
352 | 352 |
353 if (ret < 0 && errno == EAGAIN) | 353 if (ret < 0 && errno == EAGAIN) |
354 ret = 0; | 354 ret = 0; |
355 if (ret < len) { | 355 if (ret >= 0 && ret < len) { |
356 if (servconn->tx_handler == -1) | 356 if (servconn->tx_handler == -1) |
357 servconn->tx_handler = purple_input_add( | 357 servconn->tx_handler = purple_input_add( |
358 servconn->fd, PURPLE_INPUT_WRITE, | 358 servconn->fd, PURPLE_INPUT_WRITE, |
359 servconn_write_cb, servconn); | 359 servconn_write_cb, servconn); |
360 purple_circ_buffer_append(servconn->tx_buf, buf + ret, | 360 purple_circ_buffer_append(servconn->tx_buf, buf + ret, |