mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
common: Fix put_membuf.
* common/membuf.c (put_membuf): Allow NULL for the second arg. -- There has been such a use case in keybox-blob.c. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
c4ba712736
commit
f271c69164
@ -111,7 +111,10 @@ put_membuf (membuf_t *mb, const void *buf, size_t len)
|
||||
}
|
||||
mb->buf = p;
|
||||
}
|
||||
memcpy (mb->buf + mb->len, buf, len);
|
||||
if (buf)
|
||||
memcpy (mb->buf + mb->len, buf, len);
|
||||
else
|
||||
memset (mb->buf + mb->len, 0, len);
|
||||
mb->len += len;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user