diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ChangeLog.ja | 7 | ||||
-rw-r--r-- | libsylph/procmsg.c | 9 | ||||
-rw-r--r-- | libsylph/session.c | 7 |
4 files changed, 26 insertions, 4 deletions
@@ -1,5 +1,12 @@ 2006-09-13 + * libsylph/procmsg.c: procmsg_read_cache(): fixed crash when reading + a corrupted cache data. + * libsylph/session.c: session_read_data_as_file_cb(): fflush buffer + and check error before rewind(). + +2006-09-13 + * libsylph/procmime.c: procmime_decode_content(): fflush temporary file and check errors. diff --git a/ChangeLog.ja b/ChangeLog.ja index 4b8800ff..cb40820f 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,12 @@ 2006-09-13 + * libsylph/procmsg.c: procmsg_read_cache(): 壊れたキャッシュデータを + 読んだときにクラッシュするのを修正。 + * libsylph/session.c: session_read_data_as_file_cb(): rewind() の前に + バッファを fflush し、エラーをチェックするようにした。 + +2006-09-13 + * libsylph/procmime.c: procmime_decode_content(): 一時ファイルを fflush し、エラーをチェックするようにした。 diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c index 13141f50..37546154 100644 --- a/libsylph/procmsg.c +++ b/libsylph/procmsg.c @@ -156,10 +156,11 @@ gint procmsg_read_cache_data_str(FILE *fp, gchar **str) #define READ_CACHE_DATA(data, fp) \ { \ if (procmsg_read_cache_data_str(fp, &data) < 0) { \ + g_warning("Cache data is corrupted\n"); \ procmsg_msginfo_free(msginfo); \ procmsg_msg_list_free(mlist); \ - mlist = NULL; \ - break; \ + fclose(fp); \ + return NULL; \ } \ } @@ -171,8 +172,8 @@ gint procmsg_read_cache_data_str(FILE *fp, gchar **str) g_warning("Cache data is corrupted\n"); \ procmsg_msginfo_free(msginfo); \ procmsg_msg_list_free(mlist); \ - mlist = NULL; \ - break; \ + fclose(fp); \ + return NULL; \ } else \ n = idata; \ } diff --git a/libsylph/session.c b/libsylph/session.c index 8e7cd835..b8b77aff 100644 --- a/libsylph/session.c +++ b/libsylph/session.c @@ -839,6 +839,13 @@ static gboolean session_read_data_as_file_cb(SockInfo *source, } session->read_data_pos += write_len; + if (fflush(session->read_data_fp) == EOF) { + perror("fflush"); + g_warning("session_read_data_as_file_cb: " + "writing data to file failed\n"); + session->state = SESSION_ERROR; + return FALSE; + } rewind(session->read_data_fp); /* callback */ |