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.
This commit is contained in:
wwp 2017-01-18 21:48:50 +01:00
parent ff51eec7ab
commit 9657f8bebc
2 changed files with 6 additions and 8 deletions

View file

@ -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))

View file

@ -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++;