From 275ad3fa26dc70f9110965dbef8dab4e1e389ea0 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 17 Jun 2009 10:36:12 +0000 Subject: Fix bug#1040. --- g10/ChangeLog | 5 +++++ g10/parse-packet.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index fd5b3c367..c1b0085ed 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2009-06-17 Werner Koch + + * parse-packet.c (parse): Use a casted -1 instead of a 32 bit + constant to check for a garbled package. Fixes bug#1040. + 2009-06-05 David Shaw * gpg.c (main): Remove Camellia restriction. diff --git a/g10/parse-packet.c b/g10/parse-packet.c index c614ca264..60ca8af72 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -441,8 +441,8 @@ parse( IOBUF inp, PACKET *pkt, int onlykeypkts, off_t *retpos, } } - if (pktlen == 0xffffffff) { - /* with a some probability this is caused by a problem in the + if (pktlen == (unsigned long)(-1)) { + /* With some probability this is caused by a problem in the * the uncompressing layer - in some error cases it just loops * and spits out 0xff bytes. */ log_error ("%s: garbled packet detected\n", iobuf_where(inp) ); -- cgit v1.2.3