From 1d06c0fb495e228ae35f9fe60661ad3e90107535 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 20 Jul 2009 10:43:59 +0200 Subject: [PATCH] Check tny_stream_read return value for -1 (fix 1 for NB#126941) * src/modest-formatter.c (extract_text): check return value for tny_stream_read. If -1, finish processing. --- src/modest-formatter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modest-formatter.c b/src/modest-formatter.c index 8cdd091..9cd37b6 100644 --- a/src/modest-formatter.c +++ b/src/modest-formatter.c @@ -106,6 +106,9 @@ extract_text (ModestFormatter *self, TnyMimePart *body) break; n_read = tny_stream_read (input_stream, buffer, next_read); + if (G_UNLIKELY (n_read < 0)) + break; + offset = buffer; while (offset < buffer + n_read) { -- 1.7.9.5