gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libextractor] 20/27: fix signed/unsigned comparison issue


From: gnunet
Subject: [GNUnet-SVN] [libextractor] 20/27: fix signed/unsigned comparison issue
Date: Sun, 15 Oct 2017 21:34:44 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository libextractor.

commit d9d073c66b49b91403484e081eda39d4e5c17cc2
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Oct 15 20:46:58 2017 +0200

    fix signed/unsigned comparison issue
---
 src/main/extractor_datasource.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/extractor_datasource.c b/src/main/extractor_datasource.c
index 8b4c6113..888e524a 100644
--- a/src/main/extractor_datasource.c
+++ b/src/main/extractor_datasource.c
@@ -462,6 +462,7 @@ cfs_init_decompressor_zlib (struct CompressedFileSource 
*cfs,
 {
   unsigned int gzip_header_length = 10;
   unsigned char hdata[12];
+  ssize_t rsize;
 
   if (0 != bfds_seek (cfs->bfds, 0, SEEK_SET))
     {
@@ -469,7 +470,9 @@ cfs_init_decompressor_zlib (struct CompressedFileSource 
*cfs,
       return -1;
     }
   /* Process gzip header */
-  if (sizeof (hdata) > bfds_read (cfs->bfds, hdata, sizeof (hdata)))
+  rsize = bfds_read (cfs->bfds, hdata, sizeof (hdata));
+  if ( (-1 == rsize) ||
+       (sizeof (hdata) > (size_t) rsize) )
     return -1;
   if (0 != (hdata[3] & 0x4)) /* FEXTRA  set */
     gzip_header_length += 2 + (hdata[10] & 0xff) + ((hdata[11] & 0xff) * 256);

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]