diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-11 17:22:15 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-11-11 17:22:15 -0500 |
commit | f2ad2bdd0abfb1ce8f274fbb01a82e209f4cc122 (patch) | |
tree | b7724a79e086a7773fe717096834b4ee0f9bb905 /contrib/pgcrypto/pgp-decrypt.c | |
parent | 2edfc021c64ac2b15c9e9f9ada037ad12150bfa9 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c index 9aabd66e7e6..704cf2ef855 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) |