[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.4-20-g0a3bec2
by NIIBE Yutaka
cvs at cvs.gnupg.org
Mon Feb 12 11:00:57 CET 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, STABLE-BRANCH-2-2 has been updated
via 0a3bec2c2525935362f87dce93d7df2c8d498498 (commit)
from e0658b19d93b38ed9ebd07734c4678acdde1607d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0a3bec2c2525935362f87dce93d7df2c8d498498
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Mon Feb 12 18:56:58 2018 +0900
scd: Fix handling for Data Object with no data.
* scd/app-openpgp.c (get_cached_data): Return NULL for Data Object
with no data.
--
When GET_DATA returns no data with success (90 00), this routine
firstly returned buffer with length zero, and secondly (with cache)
returned NULL, which is inconsistent. Now, it returns NULL for both
cases.
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index c9f2840..5b1b0d3 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -348,7 +348,8 @@ get_cached_data (app_t app, int tag,
err = iso7816_get_data (app->slot, exmode, tag, &p, &len);
if (err)
return err;
- *result = p;
+ if (len)
+ *result = p;
*resultlen = len;
/* Check whether we should cache this object. */
@@ -370,7 +371,10 @@ get_cached_data (app_t app, int tag,
c = xtrymalloc (sizeof *c + len);
if (c)
{
- memcpy (c->data, p, len);
+ if (len)
+ memcpy (c->data, p, len);
+ else
+ xfree (p);
c->length = len;
c->tag = tag;
c->next = app->app_local->cache;
-----------------------------------------------------------------------
Summary of changes:
scd/app-openpgp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list