mirror of
git://git.gnupg.org/gnupg.git
synced 2025-06-26 21:47:57 +02:00
sm: Fix error checking of decryption result.
* sm/call-agent.c (gpgsm_agent_pkdecrypt): Fix condition. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
3ba091ab8c
commit
15fe78184c
@ -528,7 +528,8 @@ gpgsm_agent_pkdecrypt (ctrl_t ctrl, const char *keygrip, const char *desc,
|
||||
return rc;
|
||||
}
|
||||
|
||||
put_membuf (&data, "", 1); /* Make sure it is 0 terminated so we can invoke strtoul safely. */
|
||||
/* Make sure it is 0 terminated so we can invoke strtoul safely. */
|
||||
put_membuf (&data, "", 1);
|
||||
buf = get_membuf (&data, &len);
|
||||
if (!buf)
|
||||
return gpg_error (GPG_ERR_ENOMEM);
|
||||
@ -559,7 +560,7 @@ gpgsm_agent_pkdecrypt (ctrl_t ctrl, const char *keygrip, const char *desc,
|
||||
if (!n || *endp != ':')
|
||||
return gpg_error (GPG_ERR_INV_SEXP);
|
||||
endp++;
|
||||
if (endp-p+n > len)
|
||||
if (endp-p+n != len)
|
||||
return gpg_error (GPG_ERR_INV_SEXP); /* Oops: Inconsistent S-Exp. */
|
||||
|
||||
memmove (buf, endp, n);
|
||||
|
Loading…
x
Reference in New Issue
Block a user