mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
tools: Fix use of uninitialized var in mime-maker.
* tools/mime-maker.c (ensure_part): Make sure to set R_PARENT on error. (add_missing_headers): Ensure that ERR is set on success. * tools/wks-util.c (wks_parse_policy): Fix indentation. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
b265969154
commit
dd03667ab1
@ -251,7 +251,11 @@ ensure_part (mime_maker_t ctx, part_t *r_parent)
|
|||||||
{
|
{
|
||||||
ctx->mail = xtrycalloc (1, sizeof *ctx->mail);
|
ctx->mail = xtrycalloc (1, sizeof *ctx->mail);
|
||||||
if (!ctx->mail)
|
if (!ctx->mail)
|
||||||
|
{
|
||||||
|
if (r_parent)
|
||||||
|
*r_parent = NULL;
|
||||||
return gpg_error_from_syserror ();
|
return gpg_error_from_syserror ();
|
||||||
|
}
|
||||||
log_assert (!ctx->current_part);
|
log_assert (!ctx->current_part);
|
||||||
ctx->current_part = ctx->mail;
|
ctx->current_part = ctx->mail;
|
||||||
ctx->current_part->headers_tail = &ctx->current_part->headers;
|
ctx->current_part->headers_tail = &ctx->current_part->headers;
|
||||||
@ -722,6 +726,7 @@ add_missing_headers (mime_maker_t ctx)
|
|||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = 0;
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
return err;
|
return err;
|
||||||
|
@ -164,6 +164,7 @@ wks_parse_policy (policy_flags_t flags, estream_t stream, int ignore_unknown)
|
|||||||
|
|
||||||
if (!err && !es_feof (stream))
|
if (!err && !es_feof (stream))
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
if (err)
|
if (err)
|
||||||
log_error ("error reading '%s', line %d: %s\n",
|
log_error ("error reading '%s', line %d: %s\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user