summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/pgp-decrypt.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-07-18 17:09:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-07-18 17:09:01 +0000
commit2787db9b1d3a041913d0b5e8c888bc9619f6571a (patch)
treebb23569f7c124c28a0509a6f9dcd6ad032b47b35 /contrib/pgcrypto/pgp-decrypt.c
parentdd4a190d188865e9626441c314f2ff331a631f58 (diff)
downloadpostgresql-2787db9b1d3a041913d0b5e8c888bc9619f6571a.tar.gz
Small cleanups for pgcrypto. Marko Kreen
Diffstat (limited to 'contrib/pgcrypto/pgp-decrypt.c')
-rw-r--r--contrib/pgcrypto/pgp-decrypt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c
index 1817361075..1fc4f4feb0 100644
--- a/contrib/pgcrypto/pgp-decrypt.c
+++ b/contrib/pgcrypto/pgp-decrypt.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.3 2005/07/18 16:35:06 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.4 2005/07/18 17:09:01 tgl Exp $
*/
#include "postgres.h"
@@ -339,7 +339,6 @@ static void mdc_free(void *priv)
ctx->mdc_ctx = NULL;
}
-/* fixme: clarify */
static int mdc_finish(PGP_Context *ctx, PullFilter *src,
int len, uint8 **data_p)
{
@@ -364,6 +363,7 @@ static int mdc_finish(PGP_Context *ctx, PullFilter *src,
return 0;
}
+ /* safety check */
if (ctx->in_mdc_pkt > 1)
{
px_debug("mdc_finish: several times here?");
@@ -371,6 +371,7 @@ static int mdc_finish(PGP_Context *ctx, PullFilter *src,
}
ctx->in_mdc_pkt++;
+ /* is the packet sane? */
if (res != 20)
{
px_debug("mdc_finish: read failed, res=%d", res);