aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-scd.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/call-scd.c')
-rw-r--r--agent/call-scd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 91e28e68c..3da16e619 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -548,7 +548,8 @@ padding_info_cb (void *opaque, const char *line)
if ((s=has_leading_keyword (line, "PADDING")))
{
- *r_padding = atoi (s);
+ if (r_padding)
+ *r_padding = atoi (s);
}
else if ((s=has_leading_keyword (line, "PINCACHE_PUT")))
err = handle_pincache_put (s);
@@ -560,8 +561,8 @@ padding_info_cb (void *opaque, const char *line)
/* Decipher INDATA using the current card. Note that the returned
* value is not an s-expression but the raw data as returned by
* scdaemon. The padding information is stored at R_PADDING with -1
- * for not known. DESC_TEXT is an additional parameter passed to
- * GETPIN_CB. */
+ * for not known, when it's not NULL. DESC_TEXT is an additional
+ * parameter passed to GETPIN_CB. */
int
agent_card_pkdecrypt (ctrl_t ctrl,
const char *keyid,
@@ -579,7 +580,8 @@ agent_card_pkdecrypt (ctrl_t ctrl,
size_t len;
*r_buf = NULL;
- *r_padding = -1; /* Unknown. */
+ if (r_padding)
+ *r_padding = -1; /* Unknown. */
rc = start_scd (ctrl);
if (rc)
return rc;