summaryrefslogtreecommitdiffstats
path: root/src/file_gpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-04-27 08:16:42 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2010-04-27 08:16:42 +0200
commit983f0a6f8779fdfd6d320da8a3c797dc33f2bd9c (patch)
treee48b6938f62ece5c806e01348f7401e25c3b89c5 /src/file_gpg.c
parent93e6e7884a87722ee4b6fb668f6c81017f14d4ea (diff)
PhotoRec: fix gpg recovery
Diffstat (limited to 'src/file_gpg.c')
-rw-r--r--src/file_gpg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/file_gpg.c b/src/file_gpg.c
index 53e7d7a..2179fda 100644
--- a/src/file_gpg.c
+++ b/src/file_gpg.c
@@ -99,10 +99,10 @@ static unsigned int openpgp_length_type(const unsigned char *buf, unsigned int *
return buf[1];
case 1:
*length_type=3;
- return (buf[1] << 8) + buf[2];
+ return (buf[1] << 8) | buf[2];
case 2:
*length_type=5;
- return (buf[1] << 24) +(buf[2] << 16) + (buf[3] << 8) + buf[4];
+ return (buf[1] << 24) |(buf[2] << 16) | (buf[3] << 8) | buf[4];
default:
*length_type=1;
return 0;
@@ -178,7 +178,7 @@ static int header_check_gpg(const unsigned char *buffer, const unsigned int buff
memset(packet_tag, 0, sizeof(packet_tag));
memset(length_type, 0, sizeof(length_type));
memset(length, 0, sizeof(length));
- while(nbr<5 && potential_frame_offset+5< buffer_size)
+ while(nbr<5 && potential_frame_offset < buffer_size - 5)
{
packet_tag[nbr]=openpgp_packet_tag(&buffer[potential_frame_offset]);
if(packet_tag[nbr]==0) /* Reserved */