talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 9657f8bebce60d1cf16061a4fee139e2bb9def9e
parent ff51eec7ab27e5a5766e586ae03f9ef89a47aa39
Author: wwp <wwp@free.fr>
Date:   Wed, 18 Jan 2017 21:48:50 +0100

Fix bug 3762, 'redirect fails'
by removing an check added at 3.14.1.39-g989b3a3, thought I was hardening
sanity checks and I changed the logics, making it fail while in normal
situation. Removed few more extraneous checks.

Diffstat:
Msrc/compose.c | 4+---
Msrc/procheader.c | 10+++++-----
2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/compose.c b/src/compose.c @@ -5543,8 +5543,6 @@ static gint compose_redirect_write_to_file(Compose *compose, FILE *fdest) if (g_ascii_strncasecmp(buf, not_included[i], strlen(not_included[i])) == 0) { skip = TRUE; - g_free(buf); - buf = NULL; break; } } @@ -5588,7 +5586,7 @@ static gint compose_redirect_write_to_file(Compose *compose, FILE *fdest) goto error; } - if (err || ret == -1) + if (err) goto error; if (compose_redirect_write_headers(compose, fdest)) diff --git a/src/procheader.c b/src/procheader.c @@ -135,7 +135,7 @@ static gint generic_get_one_field(gchar **bufptr, void *data, size_t len; gchar *buf; -/* cm_return_val_if_fail(bufptr != NULL, -1); TODO */ + cm_return_val_if_fail(bufptr != NULL, -1); len = BUFFSIZE; buf = g_malloc(len); @@ -269,7 +269,7 @@ GPtrArray *procheader_get_header_array_asis(FILE *fp) headers = g_ptr_array_new(); - while (procheader_get_one_field_asis(&buf, fp) != -1 && buf != NULL) { + while (procheader_get_one_field_asis(&buf, fp) != -1) { if ((header = procheader_parse_header(buf)) != NULL) g_ptr_array_add(headers, header); g_free(buf); @@ -390,7 +390,7 @@ void procheader_get_header_fields(FILE *fp, HeaderEntry hentry[]) if (hentry == NULL) return; - while ((hnum = procheader_get_one_field(&buf, fp, hentry)) != -1 && buf != NULL) { + while ((hnum = procheader_get_one_field(&buf, fp, hentry)) != -1) { hp = hentry + hnum; p = buf + strlen(hp->name); @@ -579,7 +579,7 @@ static MsgInfo *parse_stream(void *data, gboolean isstring, MsgFlags flags, hentry = procheader_get_headernames(full); if (MSG_IS_QUEUED(flags) || MSG_IS_DRAFT(flags)) { - while (get_one_field(&buf, data, NULL) != -1 && buf != NULL) { + while (get_one_field(&buf, data, NULL) != -1) { if ((!strncmp(buf, "X-Claws-End-Special-Headers: 1", strlen("X-Claws-End-Special-Headers:"))) || (!strncmp(buf, "X-Sylpheed-End-Special-Headers: 1", @@ -619,7 +619,7 @@ static MsgInfo *parse_stream(void *data, gboolean isstring, MsgFlags flags, avatar_hook_id = 0; } - while ((hnum = get_one_field(&buf, data, hentry)) != -1 && buf != NULL) { + while ((hnum = get_one_field(&buf, data, hentry)) != -1) { hp = buf + strlen(hentry[hnum].name); while (*hp == ' ' || *hp == '\t') hp++;