diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-03-19 10:21:44 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-03-19 10:21:44 +0800 |
commit | d6d7dc41d026a2a2bc907446e26f22e978d51f45 (patch) | |
tree | b48aeabd1bec69791f4ba4b2b05ea1336ec08c20 | |
parent | 93314d904125e37d567b4669bd3c0170ab8d7e4e (diff) | |
download | gsoc2013-evolution-d6d7dc41d026a2a2bc907446e26f22e978d51f45.tar.gz gsoc2013-evolution-d6d7dc41d026a2a2bc907446e26f22e978d51f45.tar.zst gsoc2013-evolution-d6d7dc41d026a2a2bc907446e26f22e978d51f45.zip |
Protect against a possibly NULL exception.
2001-03-18 Jeffrey Stedfast <fejj@ximian.com>
* camel-remote-store.c (remote_recv_line): Protect against a
possibly NULL exception.
svn path=/trunk/; revision=8811
-rw-r--r-- | camel/ChangeLog | 3 | ||||
-rw-r--r-- | camel/camel-remote-store.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index b42c5ba626..e5c564e41d 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,8 @@ 2001-03-18 Jeffrey Stedfast <fejj@ximian.com> + * camel-remote-store.c (remote_recv_line): Protect against a + possibly NULL exception. + * camel-filter-driver.c (camel_filter_driver_filter_message): Document and modify to return a boolean value denoting whether or not errors occured during processing. diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index ef06eb71ec..856bcf120f 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -419,6 +419,7 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex) CamelStreamBuffer *stream; GByteArray *bytes; gchar buf[1024], *ret; + gboolean exception = FALSE; gint nread; *dest = NULL; @@ -444,15 +445,17 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex) } while (nread == sizeof (buf) - 1); if (nread == -1) { + exception = TRUE; if (errno == EINTR) camel_exception_set(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); else camel_exception_set(ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, strerror(errno)); } else if (bytes->len == 0) { + exception = TRUE; camel_exception_set(ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, _("Server unexpectedly disconnected")); } - if (camel_exception_is_set (ex)) { + if (camel_exception_is_set (ex) || exception) { g_byte_array_free(bytes, TRUE); camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); return -1; |