summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/pgp-decrypt.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-11-11 17:22:15 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2014-11-11 17:22:44 -0500
commit4a9710e6edd1a23f6a053eb4b58b2b784245dc7e (patch)
treeeb1eb3af445c58877fd8cef67f462bb24c88c9f9 /contrib/pgcrypto/pgp-decrypt.c
parent1c2f9a4f6e07d7870e2fed1cb314e673a6f4858d (diff)
Loop when necessary in contrib/pgcrypto's pktreader_pull().
This fixes a scenario in which pgp_sym_decrypt() failed with "Wrong key or corrupt data" on messages whose length is 6 less than a power of 2. Per bug #11905 from Connor Penhale. Fix by Marko Tiikkaja, regression test case from Jeff Janes.
Diffstat (limited to 'contrib/pgcrypto/pgp-decrypt.c')
-rw-r--r--contrib/pgcrypto/pgp-decrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c
index e03ee7f5f02..1fd7cf39767 100644
--- a/contrib/pgcrypto/pgp-decrypt.c
+++ b/contrib/pgcrypto/pgp-decrypt.c
@@ -182,7 +182,7 @@ pktreader_pull(void *priv, PullFilter *src, int len,
if (pkt->type == PKT_CONTEXT)
return pullf_read(src, len, data_p);
- if (pkt->len == 0)
+ while (pkt->len == 0)
{
/* this was last chunk in stream */
if (pkt->type == PKT_NORMAL)