sm: Fix a warning in an es_fopencooie function.

* sm/certdump.c (format_name_writer): Take care of a flush request.
--

We won't see a flush here so that fix does not solve a real bug but we
want to be correct.  Note that this function seems to predate the
es_fopenmem function and thus in master (2.3) we should replace it
entirely.

GnuPG-bug-id: 4495
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from 2.2 commit 8d0d61aca3)
This commit is contained in:
Werner Koch 2019-05-12 20:41:32 +02:00
parent 103c1576b7
commit c7ff8c59b9
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 4 additions and 0 deletions

View File

@ -658,6 +658,10 @@ format_name_writer (void *cookie, const void *buffer, size_t size)
struct format_name_cookie *c = cookie;
char *p;
/* FIXME: Replace the whole thing using es_fopenmem based code. */
if (!buffer) /* Flush. */
return 0; /* (Actually we could use SIZE because that should be 0 too.) */
if (!c->buffer)
{
p = xtrymalloc (size + 1 + 1);