From b9c5484aead7649b87aca2a3a06bc8eccbeb8844 Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Wed, 30 Mar 2011 02:21:47 -0400 Subject: [PATCH] Properly handle zero-length packets, by removing special case code which avoided doing so. --- lib/Crypt/OpenPGP/PacketFactory.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Crypt/OpenPGP/PacketFactory.pm b/lib/Crypt/OpenPGP/PacketFactory.pm index eba1ad8..d8828b3 100644 --- a/lib/Crypt/OpenPGP/PacketFactory.pm +++ b/lib/Crypt/OpenPGP/PacketFactory.pm @@ -55,7 +55,7 @@ sub parse { my($type, $len, $partial, $hdrlen, $b); do { ($type, $len, $partial, $hdrlen) = $class->_parse_header($buf); - $b = $buf->extract($len ? $len : $buf->length - $buf->offset); + $b = $buf->extract($len); return unless $type; } while !$find{$type}; ## Skip